public class AudioCaptureClient : ComObject
Enables a client to read input data from a capture endpoint buffer. For more information, see .
AudioCaptureClient(IntPtr ptr)
Initializes a new instance of the AudioCaptureClient class.
public void AudioCaptureClient(IntPtr ptr)
Parameters
ptr
IntPtrThe native pointer of the IAudioCaptureClient COM object.
FromAudioClient(AudioClient audioClient)
Creates a new AudioCaptureClient by calling the GetService method of the specified audioClient.
public static AudioCaptureClient FromAudioClient(AudioClient audioClient)
Parameters
audioClient
AudioClientThe AudioClient which should be used to create the AudioCaptureClient-instance with.
Returns
A new instance of the AudioCaptureClient class.
GetBuffer(Int32& framesRead, AudioClientBufferFlags& flags)
Retrieves a pointer to the next available packet of data in the capture endpoint buffer. For more information see .
public IntPtr GetBuffer(Int32& framesRead, AudioClientBufferFlags& flags)
Parameters
framesRead
Int32&Variable into which the method writes the frame count (the number of audio frames available in the data packet). The client should either read the entire data packet or none of it.
flags
AudioClientBufferFlags&Variable into which the method writes the buffer-status flags.
Returns
Pointer to a variable which stores the starting address of the next data packet that is available for the client to read.
Remarks
Use Marshal.Copy to convert the pointer to the buffer into an array.
GetBuffer(Int32& framesRead, AudioClientBufferFlags& flags, Int64& devicePosition, Int64& qpcPosition)
Retrieves a pointer to the next available packet of data in the capture endpoint buffer. For more information see .
public IntPtr GetBuffer(Int32& framesRead, AudioClientBufferFlags& flags, Int64& devicePosition, Int64& qpcPosition)
Parameters
framesRead
Int32&Variable into which the method writes the frame count (the number of audio frames available in the data packet). The client should either read the entire data packet or none of it.
flags
AudioClientBufferFlags&Variable into which the method writes the buffer-status flags.
devicePosition
Int64&Variable into which the method writes the device position of the first audio frame in the data packet. The device position is expressed as the number of audio frames from the start of the stream.
qpcPosition
Int64&Variable into which the method writes the value of the performance counter at the time that the audio endpoint device recorded the device position of the first audio frame in the data packet.
Returns
Pointer to a variable which stores the starting address of the next data packet that is available for the client to read.
Remarks
Use Marshal.Copy to convert the pointer to the buffer into an array.
GetBufferNative(IntPtr& data, Int32& numFramesRead, AudioClientBufferFlags& flags, Int64& devicePosition, Int64& qpcPosition)
Retrieves a pointer to the next available packet of data in the capture endpoint buffer. For more information see .
public Int32 GetBufferNative(IntPtr& data, Int32& numFramesRead, AudioClientBufferFlags& flags, Int64& devicePosition, Int64& qpcPosition)
Parameters
data
IntPtr&A pointer variable into which the method writes the starting address of the next data packet that is available for the client to read.
numFramesRead
Int32&Variable into which the method writes the frame count (the number of audio frames available in the data packet). The client should either read the entire data packet or none of it.
flags
AudioClientBufferFlags&Variable into which the method writes the buffer-status flags.
devicePosition
Int64&Variable into which the method writes the device position of the first audio frame in the data packet. The device position is expressed as the number of audio frames from the start of the stream.
qpcPosition
Int64&Variable into which the method writes the value of the performance counter at the time that the audio endpoint device recorded the device position of the first audio frame in the data packet.
Returns
HRESULT
GetNextPacketSize()
The GetNextPacketSize method retrieves the number of frames in the next data packet in the capture endpoint buffer. For more information, see .
GetNextPacketSizeNative(Int32& numFramesInNextPacket)
The GetNextPacketSize method retrieves the number of frames in the next data packet in the capture endpoint buffer. For more information, see .
public Int32 GetNextPacketSizeNative(Int32& numFramesInNextPacket)
Parameters
numFramesInNextPacket
Int32&Variable into which the method writes the frame count (the number of audio frames in the next capture packet).
Returns
HRESULT
ReleaseBuffer(Int32 framesRead)
The ReleaseBuffer method releases the buffer. For more information, see .
public void ReleaseBuffer(Int32 framesRead)
Parameters
framesRead
Int32The number of audio frames that the client read from the capture buffer. This parameter must be either equal to the number of frames in the previously acquired data packet or 0.
ReleaseBufferNative(Int32 framesRead)
The ReleaseBuffer method releases the buffer. For more information, see .
public Int32 ReleaseBufferNative(Int32 framesRead)
Parameters
framesRead
Int32The number of audio frames that the client read from the capture buffer. This parameter must be either equal to the number of frames in the previously acquired data packet or 0.
Returns
HRESULT
NextPacketSize
Gets the size of the next packet in frames (the size of one frame equals the blockalign value of the waveformat).
public Int32 NextPacketSize { get; }