using System;
using System.Runtime.InteropServices;
using NAudio.Wave;
namespace NAudio.CoreAudioApi.Interfaces
{
///
/// Windows CoreAudio IAudioClient interface
/// Defined in AudioClient.h
///
[Guid("1CB9AD4C-DBFA-4c32-B178-C2F568A703B2"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
ComImport]
public interface IAudioClient
{
[PreserveSig]
int Initialize(AudioClientShareMode shareMode,
AudioClientStreamFlags streamFlags,
long hnsBufferDuration, // REFERENCE_TIME
long hnsPeriodicity, // REFERENCE_TIME
[In] WaveFormat pFormat,
[In] ref Guid audioSessionGuid);
///
/// The GetBufferSize method retrieves the size (maximum capacity) of the endpoint buffer.
///
int GetBufferSize(out uint bufferSize);
[return: MarshalAs(UnmanagedType.I8)]
long GetStreamLatency();
int GetCurrentPadding(out int currentPadding);
[PreserveSig]
int IsFormatSupported(
AudioClientShareMode shareMode,
[In] WaveFormat pFormat,
IntPtr closestMatchFormat); // or outIntPtr??
int GetMixFormat(out IntPtr deviceFormatPointer);
// REFERENCE_TIME is 64 bit int
int GetDevicePeriod(out long defaultDevicePeriod, out long minimumDevicePeriod);
int Start();
int Stop();
int Reset();
int SetEventHandle(IntPtr eventHandle);
///
/// The GetService method accesses additional services from the audio client object.
///
/// The interface ID for the requested service.
/// Pointer to a pointer variable into which the method writes the address of an instance of the requested interface.
[PreserveSig]
int GetService([In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceId, [Out, MarshalAs(UnmanagedType.IUnknown)] out object interfacePointer);
}
}