Compartilhar via


IAudioClient Interface

Previous Next

IAudioClient Interface

The IAudioClient interface enables a client to create and initialize an audio stream between an audio application and the audio engine (for a shared-mode stream) or the hardware buffer of an audio endpoint device (for an exclusive-mode stream). A client obtains a reference to an IAudioClient interface for an audio endpoint device by following these steps:

  1. By using one of the techniques described in IMMDevice Interface, obtain a reference to the IMMDevice interface for an audio endpoint device.
  2. Call the IMMDevice::Activate method with parameter iid set to REFIID IID_IAudioClient.

The application thread that uses this interface must be initialized for COM. For more information about COM initialization, see the description of the CoInitializeEx function in the Windows SDK documentation.

For code examples that use the IAudioClient interface, see the following topics:

IAudioClient inherits from the IUnknown interface. In addition to the methods inherited from IUnknown, IAudioClient supports the following methods.

Method Description
GetBufferSize Retrieves the size (maximum capacity) of the audio buffer associated with the endpoint.
GetCurrentPadding Retrieves the number of frames of padding in the endpoint buffer.
GetDevicePeriod Retrieves the length of the periodic interval separating successive processing passes by the audio engine on the data in the endpoint buffer.
GetMixFormat Retrieves the stream format that the audio engine uses for its internal processing of shared-mode streams.
GetService Accesses additional services from the audio client object.
GetStreamLatency Retrieves the maximum latency for the current stream and can be called any time after the stream has been initialized.
Initialize Initializes the audio stream.
IsFormatSupported Indicates whether the audio endpoint device supports a particular stream format.
Reset Resets the audio stream.
SetEventHandle Sets the event handle that the audio engine will signal each time a buffer becomes ready to be processed by the client.
Start Starts the audio stream.
Stop Stops the audio stream.

Requirements

Client: Windows Vista

Header: Include Audioclient.h.

See Also

Previous Next