Skip to main content

CreateRenderAudioStateMonitor

[Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.] Creates a new instance of IAudioStateMonitor that monitors the audio level of all audio-rendering streams.

Syntax

Parameters

audioStateMonitor _Out_
Type: IAudioStateMonitor**
This output parameter is populated with the created IAudioStateMonitor object.

Return value

Type: HRESULT If the method succeeds, it returns S\_OK.

Remarks

This is one of the functions that create and return an AudioStateMonitor instance. There are four variants each for capturr and render streams, to determine whether a process can do one of the following for a given role:
  • Capture or render any audio of any category
  • Capture or render audio of a specific category
  • Capture or render audio of a specific category, to a specific endpoint.
    The endpoint may be specified using the MMDevice ID (obtained using IMMDevice::GetId()), or by using its SWD ID (obtained using Windows.Devices.Enumeration or Windows.Media.Devices.MediaDevice)
  • Capture or render audio of a specific category to the default endpoint
Consider the following scenario, where a game chooses to play GameMedia audio only when it is known that the audio will not be muted by the OS due to policy. To achieve this, the game registers for SoundLevel notifications for the AudioCategory_GameMedia stream category on the default console endpoint. If the SoundLevel for this category is set to ‘Muted’ then the game will stop playback of its GameMedia stream. If the SoundLevel is set to anything else, the game chooses to play its GameMedia stream.

Requirements

Header: Audiostatemonitorapi.h Library: Windows.Media.MediaControl.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

AUDIO_STREAM_CATEGORY About WASAPI WASAPI
Last modified on August 20, 2026