Example #1
0
 static MMDevice GetDefaultAudioEndpoint()
 {
     if (Environment.OSVersion.Version.Major < 6)
     {
         throw new NotSupportedException("WASAPI supported only on Windows Vista and above");
     }
     var enumerator = new MMDeviceEnumerator();
     return enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console);
 }
Example #2
0
 /// <summary>
 /// Gets the default audio capture device
 /// </summary>
 /// <returns>The default audio capture device</returns>
 public static MMDevice GetDefaultCaptureDevice()
 {
     var devices = new MMDeviceEnumerator();
     return devices.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Console);
 }
Example #3
0
 /// <summary>
 /// Gets the default audio loopback capture device
 /// </summary>
 /// <returns>The default audio loopback capture device</returns>
 public static MMDevice GetDefaultLoopbackCaptureDevice()
 {
     MMDeviceEnumerator devices = new MMDeviceEnumerator();
     return devices.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
 }
Example #4
0
        /// <summary>
        /// Gets the default audio capture device
        /// </summary>
        /// <returns>The default audio capture device</returns>
        public static MMDevice GetDefaultCaptureDevice()
        {
            var devices = new MMDeviceEnumerator();

            return(devices.GetDefaultAudioEndpoint(DataFlow.Capture, Role.Console));
        }