IAudioSessionEvents interface

The IAudioSessionEvents interface provides notifications of session-related events such as changes in the volume level, display name, and session state. Unlike the other interfaces in this section, which are implemented by the WASAPI system component, a WASAPI client implements the IAudioSessionEvents interface. To receive event notifications, the client passes a pointer to its IAudioSessionEvents interface to the IAudioSessionControl::RegisterAudioSessionNotification method.

After registering its IAudioClientSessionEvents interface, the client receives event notifications in the form of callbacks through the methods in the interface.

In implementing the IAudioSessionEvents interface, the client should observe these rules to avoid deadlocks and undefined behavior:

  • The methods in the interface must be nonblocking. The client should never wait on a synchronization object during an event callback.
  • The client should never call the IAudioSessionControl::UnregisterAudioSessionNotification method during an event callback.
  • The client should never release the final reference on a WASAPI object during an event callback.
For a code example that implements an IAudioSessionEvents interface, see Audio Session Events. For a code example that registers a client's IAudioSessionEvents interface to receive notifications, see Audio Events for Legacy Audio Applications.

Methods

The IAudioSessionEvents interface has these methods.

Method Description
IAudioSessionEvents::OnChannelVolumeChanged The OnChannelVolumeChanged method notifies the client that the volume level of an audio channel in the session submix has changed.
IAudioSessionEvents::OnDisplayNameChanged The OnDisplayNameChanged method notifies the client that the display name for the session has changed.
IAudioSessionEvents::OnGroupingParamChanged The OnGroupingParamChanged method notifies the client that the grouping parameter for the session has changed.
IAudioSessionEvents::OnIconPathChanged The OnIconPathChanged method notifies the client that the display icon for the session has changed.
IAudioSessionEvents::OnSessionDisconnected The OnSessionDisconnected method notifies the client that the audio session has been disconnected.
IAudioSessionEvents::OnSimpleVolumeChanged The OnSimpleVolumeChanged method notifies the client that the volume level or muting state of the audio session has changed.
IAudioSessionEvents::OnStateChanged The OnStateChanged method notifies the client that the stream-activity state of the session has changed.

Requirements

   
Windows version Windows Vista [desktop apps | UWP apps] Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header audiopolicy.h

See Also

Core Audio Interfaces

IAudioSessionControl::RegisterAudioSessionNotification

IAudioSessionControl::UnregisterAudioSessionNotification

WASAPI