Media​Device Media​Device Media​Device Class

Definition

Provides methods used to select devices for capturing and rendering audio, and for capturing video.

public : static class MediaDevicepublic static class MediaDevicePublic Static Class MediaDevice
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

GetAudioCaptureSelector() GetAudioCaptureSelector() GetAudioCaptureSelector()

Returns the identifier string of a device for capturing audio.

public : static PlatForm::String GetAudioCaptureSelector()public static string GetAudioCaptureSelector()Public Static Function GetAudioCaptureSelector() As string
Returns
PlatForm::String string string

The identifier string of the audio capture device.

Attributes

GetAudioRenderSelector() GetAudioRenderSelector() GetAudioRenderSelector()

Returns the identifier string of a device for rendering audio.

public : static PlatForm::String GetAudioRenderSelector()public static string GetAudioRenderSelector()Public Static Function GetAudioRenderSelector() As string
Returns
PlatForm::String string string

The identifier string of the audio rendering device.

Attributes

GetDefaultAudioCaptureId(AudioDeviceRole) GetDefaultAudioCaptureId(AudioDeviceRole) GetDefaultAudioCaptureId(AudioDeviceRole)

Returns the identifier string of the default device for capturing audio in the specified role.

public : static PlatForm::String GetDefaultAudioCaptureId(AudioDeviceRole role)public static string GetDefaultAudioCaptureId(AudioDeviceRole role)Public Static Function GetDefaultAudioCaptureId(role As AudioDeviceRole) As string
Parameters
role
AudioDeviceRole AudioDeviceRole AudioDeviceRole

The specified audio device role (console, media, or communications).

Returns
PlatForm::String string string

The identifier string of the default device.

Attributes

GetDefaultAudioRenderId(AudioDeviceRole) GetDefaultAudioRenderId(AudioDeviceRole) GetDefaultAudioRenderId(AudioDeviceRole)

Returns the identifier string of the default device for rendering audio in the specified role.

public : static PlatForm::String GetDefaultAudioRenderId(AudioDeviceRole role)public static string GetDefaultAudioRenderId(AudioDeviceRole role)Public Static Function GetDefaultAudioRenderId(role As AudioDeviceRole) As string
Parameters
role
AudioDeviceRole AudioDeviceRole AudioDeviceRole

The specified audio device role (console, media, or communications).

Returns
PlatForm::String string string

The identifier string of the default device.

Attributes

GetVideoCaptureSelector() GetVideoCaptureSelector() GetVideoCaptureSelector()

Returns the identifier string of a device for capturing video.

public : static PlatForm::String GetVideoCaptureSelector()public static string GetVideoCaptureSelector()Public Static Function GetVideoCaptureSelector() As string
Returns
PlatForm::String string string

The identifier string of the video capture device.

Attributes

Events

DefaultAudioCaptureDeviceChanged DefaultAudioCaptureDeviceChanged DefaultAudioCaptureDeviceChanged

Raised when the default audio capture device is changed.

public : static event TypedEventHandler DefaultAudioCaptureDeviceChangedpublic static event TypedEventHandler DefaultAudioCaptureDeviceChangedPublic Static Event DefaultAudioCaptureDeviceChanged
Attributes

DefaultAudioRenderDeviceChanged DefaultAudioRenderDeviceChanged DefaultAudioRenderDeviceChanged

Raised when the default audio render device is changed.

public : static event TypedEventHandler DefaultAudioRenderDeviceChangedpublic static event TypedEventHandler DefaultAudioRenderDeviceChangedPublic Static Event DefaultAudioRenderDeviceChanged
Attributes