AudioStateMonitor.CreateForCaptureMonitoringWithCategoryAndDeviceId Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the AudioStateMonitor class that monitors the sound level for audio capture streams with the specified MediaCategory that are using the specified audio device.
public:
static AudioStateMonitor ^ CreateForCaptureMonitoringWithCategoryAndDeviceId(MediaCategory category, Platform::String ^ deviceId);
static AudioStateMonitor CreateForCaptureMonitoringWithCategoryAndDeviceId(MediaCategory const& category, winrt::hstring const& deviceId);
public static AudioStateMonitor CreateForCaptureMonitoringWithCategoryAndDeviceId(MediaCategory category, string deviceId);
function createForCaptureMonitoringWithCategoryAndDeviceId(category, deviceId)
Public Shared Function CreateForCaptureMonitoringWithCategoryAndDeviceId (category As MediaCategory, deviceId As String) As AudioStateMonitor
Parameters
- category
- MediaCategory
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 GetAudioCaptureSelector, to get the list of DeviceInformation objects representing the available audio capture devices.