MediaDevice MediaDevice MediaDevice MediaDevice Class

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

Syntax

Declaration

public static class MediaDevicepublic static class MediaDevicePublic Static Class MediaDevicepublic static class MediaDevice

Methods summary

Returns the identifier string of a device for capturing audio.

Returns the identifier string of a device for rendering audio.

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

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

Returns the identifier string of a device for capturing video.

Events summary

Raised when the default audio capture device is changed.

Raised when the default audio render device is changed.

Methods

  • GetAudioCaptureSelector()
    GetAudioCaptureSelector()
    GetAudioCaptureSelector()
    GetAudioCaptureSelector()

    Returns the identifier string of a device for capturing audio.

    public static string GetAudioCaptureSelector()public static string GetAudioCaptureSelector()Public Static Function GetAudioCaptureSelector() As stringpublic static string GetAudioCaptureSelector()

    Returns

    • string
      string
      string
      string

      The identifier string of the audio capture device.

  • GetAudioRenderSelector()
    GetAudioRenderSelector()
    GetAudioRenderSelector()
    GetAudioRenderSelector()

    Returns the identifier string of a device for rendering audio.

    public static string GetAudioRenderSelector()public static string GetAudioRenderSelector()Public Static Function GetAudioRenderSelector() As stringpublic static string GetAudioRenderSelector()

    Returns

    • string
      string
      string
      string

      The identifier string of the audio rendering device.

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

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

    public static string GetDefaultAudioCaptureId(AudioDeviceRole role)public static string GetDefaultAudioCaptureId(AudioDeviceRole role)Public Static Function GetDefaultAudioCaptureId(role As AudioDeviceRole) As stringpublic static string GetDefaultAudioCaptureId(AudioDeviceRole role)

    Parameters

    Returns

    • string
      string
      string
      string

      The identifier string of the default device.

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

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

    public static string GetDefaultAudioRenderId(AudioDeviceRole role)public static string GetDefaultAudioRenderId(AudioDeviceRole role)Public Static Function GetDefaultAudioRenderId(role As AudioDeviceRole) As stringpublic static string GetDefaultAudioRenderId(AudioDeviceRole role)

    Parameters

    Returns

    • string
      string
      string
      string

      The identifier string of the default device.

  • GetVideoCaptureSelector()
    GetVideoCaptureSelector()
    GetVideoCaptureSelector()
    GetVideoCaptureSelector()

    Returns the identifier string of a device for capturing video.

    public static string GetVideoCaptureSelector()public static string GetVideoCaptureSelector()Public Static Function GetVideoCaptureSelector() As stringpublic static string GetVideoCaptureSelector()

    Returns

    • string
      string
      string
      string

      The identifier string of the video capture device.

Events

  • DefaultAudioCaptureDeviceChanged
    DefaultAudioCaptureDeviceChanged
    DefaultAudioCaptureDeviceChanged
    DefaultAudioCaptureDeviceChanged

    Raised when the default audio capture device is changed.

    public static event TypedEventHandler DefaultAudioCaptureDeviceChangedpublic static event TypedEventHandler DefaultAudioCaptureDeviceChangedPublic Static Event DefaultAudioCaptureDeviceChangedpublic static event TypedEventHandler DefaultAudioCaptureDeviceChanged
  • DefaultAudioRenderDeviceChanged
    DefaultAudioRenderDeviceChanged
    DefaultAudioRenderDeviceChanged
    DefaultAudioRenderDeviceChanged

    Raised when the default audio render device is changed.

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

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Media.Devices.dll