IAudioSessionControl interface (audiopolicy.h)
The IAudioSessionControl interface enables a client to configure the control parameters for an audio session and to monitor events in the session. The IAudioClient::Initialize method initializes a stream object and assigns the stream to an audio session. The client obtains a reference to the IAudioSessionControl interface on a stream object by calling the IAudioClient::GetService method with parameter riid set to REFIID IID_IAudioSessionControl.
Alternatively, a client can obtain the IAudioSessionControl interface of an existing session without having to first create a stream object and add the stream to the session. Instead, the client calls the IAudioSessionManager::GetAudioSessionControl method with parameter AudioSessionGuid set to the session GUID.
The client can register to receive notification from the session manager when clients change session parameters through the methods in the IAudioSessionControl interface.
When releasing an IAudioSessionControl interface instance, the client must call the interface's Release method from the same thread as the call to IAudioClient::GetService that created the object.
The IAudioSessionControl interface controls an audio session. An audio session is a collection of shared-mode streams. This interface does not work with exclusive-mode streams.
For a code example that uses the IAudioSessionControl interface, see Audio Events for Legacy Audio Applications.
Inheritance
The IAudioSessionControl interface inherits from the IUnknown interface. IAudioSessionControl also has these types of members:
Methods
The IAudioSessionControl interface has these methods.
IAudioSessionControl::GetDisplayName The GetDisplayName method retrieves the display name for the audio session. |
IAudioSessionControl::GetGroupingParam The GetGroupingParam method retrieves the grouping parameter of the audio session. |
IAudioSessionControl::GetIconPath The GetIconPath method retrieves the path for the display icon for the audio session. |
IAudioSessionControl::GetState The GetState method retrieves the current state of the audio session. |
IAudioSessionControl::RegisterAudioSessionNotification The RegisterAudioSessionNotification method registers the client to receive notifications of session events, including changes in the stream state. |
IAudioSessionControl::SetDisplayName The SetDisplayName method assigns a display name to the current session. |
IAudioSessionControl::SetGroupingParam The SetGroupingParam method assigns a session to a grouping of sessions. |
IAudioSessionControl::SetIconPath The SetIconPath method assigns a display icon to the current session. |
IAudioSessionControl::UnregisterAudioSessionNotification The UnregisterAudioSessionNotification method deletes a previous registration by the client to receive notifications. |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | audiopolicy.h |