Поделиться через


IAudioSessionEvents Interface

Previous Next

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.

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

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

Requirements

Client: Windows Vista

Header: Include Audiopolicy.h.

See Also

Previous Next