다음을 통해 공유


IAudioSessionControl Interface

Previous Next

IAudioSessionControl Interface

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.

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

Method Description
GetIconPath Retrieves the path for the display icon for the audio session.
GetDisplayName Retrieves the display name for the audio session.
GetGroupingParam Retrieves the grouping parameter of the audio session.
GetLastActivation Retrieves the time that the audio session last changed to the active state.
GetLastInactivation Retrieves the time at which the audio session last became inactive.
GetState Retrieves the current state of the audio session.
RegisterAudioSessionNotification Registers the client to receive notifications of session events, including changes in the session state.
SetDisplayName Assigns a display name to the current audio session.
SetGroupingParam Assigns a session to a grouping of sessions.
SetIconPath Assigns a display icon to the current session.
UnregisterAudioSessionNotification Deletes a previous registration by the client to receive notifications.

Requirements

Client: Windows Vista

Header: Include Audiopolicy.h.

See Also

Previous Next