AudioStateMonitorCallback callback function (audiostatemonitorapi.h)

Called when the system changes the sound level of the audio streams being monitored by an IAudioStateMonitor.

Syntax

AudioStateMonitorCallback Audiostatemonitorcallback;

void Audiostatemonitorcallback(
  [in]           IAudioStateMonitor *audioStateMonitor,
  [in, optional] void *context
)
{...}

Parameters

[in] audioStateMonitor

The IAudioStateMonitor with which the callback was registered.

[in, optional] context

A void pointer that points to context information provided by the client in the call to IAudioStateMonitor::RegisterCallback.

Return value

None

Remarks

Windows dynamically mutes or lowers the level of audio streams in response to system events. For example, the volume of a podcast app's audio render stream may be lowered while an alarm is ringing. Or an audio recording app may have their capture stream muted when the app moves to the background. Register an implementation of this callback with a call to IAudioStateMonitor::RegisterCallback to receive notifications when the sound level for a stream changes, and then call IAudioStateMonitor::GetSoundLevel property to determine the new current audio level.

Requirements

Requirement Value
Minimum supported client Windows build 19043
Header audiostatemonitorapi.h