AudioStateMonitor.SoundLevelChanged AudioStateMonitor.SoundLevelChanged AudioStateMonitor.SoundLevelChanged AudioStateMonitor.SoundLevelChanged AudioStateMonitor.SoundLevelChanged Event

Definition

Occurs when the system changes the sound level of the audio streams being monitored by the AudioStateMonitor.

public : event TypedEventHandler<AudioStateMonitor, object> SoundLevelChanged
// Register
event_token SoundLevelChanged(TypedEventHandler<AudioStateMonitor, object> const& handler) const;

// Revoke with event_token
void SoundLevelChanged(event_token const& cookie) const;

// Revoke with event_revoker
SoundLevelChanged_revoker SoundLevelChanged(auto_revoke_t, TypedEventHandler<AudioStateMonitor, object> const& handler) const;
public event TypedEventHandler<AudioStateMonitor, object> SoundLevelChanged
Public Event SoundLevelChanged As TypedEventHandler (Of AudioStateMonitor, object)
function onSoundLevelChanged(eventArgs){/* Your code */}


audioStateMonitor.addEventListener("soundlevelchanged", onSoundLevelChanged);
audioStateMonitor.removeEventListener("soundlevelchanged", onSoundLevelChanged);

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 a handler for this event to receive notifications when the sound level for a category of audio streams changes, and then check the SoundLevel property to determine the new current audio level.