Share via


AudioStateMonitor.CreateForRenderMonitoringWithCategoryAndDeviceId Method

Definition

Initializes a new instance of the AudioStateMonitor class that monitors the sound level for audio render streams with the specified MediaCategory that are using the specified audio device.

public:
 static AudioStateMonitor ^ CreateForRenderMonitoringWithCategoryAndDeviceId(AudioRenderCategory category, Platform::String ^ deviceId);
 static AudioStateMonitor CreateForRenderMonitoringWithCategoryAndDeviceId(AudioRenderCategory const& category, winrt::hstring const& deviceId);
public static AudioStateMonitor CreateForRenderMonitoringWithCategoryAndDeviceId(AudioRenderCategory category, string deviceId);
function createForRenderMonitoringWithCategoryAndDeviceId(category, deviceId)
Public Shared Function CreateForRenderMonitoringWithCategoryAndDeviceId (category As AudioRenderCategory, deviceId As String) As AudioStateMonitor

Parameters

category
AudioRenderCategory

A value from the MediaCategory enumeration indicating the categories of audio streams that will be monitored. The system may use the category of an audio stream to determine if it should be muted or have its volume lowered in response to a particular system event.

deviceId
String

Platform::String

winrt::hstring

A string containing the unique identifier of a audio device for which associated audio streams will be monitored.

Returns

An AudioStateMonitor object.

Remarks

The method you use to instantiate AudioStateMonitor determines which audio streams are monitored. Other factory methods of the AudioStateMonitor class allow you to monitor the level of audio streams based on their AudioDeviceRole and whether the stream is capturing or rendering audio.

Call FindAllAsync, passing in the value returned by GetAudioRenderSelector, to get the list of DeviceInformation objects representing the available audio render devices.

Applies to