private void PopulateDeviceList() { foreach (AudioOutput output in AudioOutputs.GetDeviceList()) { lstAudioDevices.Items.Add(output); } }
static void Main(string[] args) { if (AudioOutputs.IsAsioSupported()) { Console.WriteLine("Asio Outputs:"); List <string> asioOutputs = AudioOutputs.GetAsioDriverNames(); foreach (string output in asioOutputs) { Console.WriteLine("\t" + output); } } if (AudioOutputs.IsDirectSoundSupported()) { Console.WriteLine("Direct Sound Outputs:"); List <string> dsOutputs = AudioOutputs.GetDirectSoundDriverNames(); foreach (string output in dsOutputs) { Console.WriteLine("\t" + output); } } if (AudioOutputs.IsWasapiSupported()) { Console.WriteLine("Wasapi Outputs:"); List <string> wOutputs = AudioOutputs.GetWasapiDeviceNames(); foreach (string output in wOutputs) { Console.WriteLine("\t" + output); } } if (AudioOutputs.IsWaveOutSupported()) { Console.WriteLine("WaveOut Outputs:"); List <string> woOutputs = AudioOutputs.GetWaveOutDeviceNames(); foreach (string output in woOutputs) { Console.WriteLine("\t" + output); } } Console.WriteLine("Press enter to exit"); Console.ReadLine(); }
/// <summary> /// Constructor for WaveOut devices /// </summary> /// <param name="deviceType"></param> /// <param name="deviceName"></param> /// <param name="deviceNumber"></param> public AudioOutput(AudioOutputs.AudioDeviceType deviceType, string deviceName, int deviceNumber) { this.deviceType = deviceType; this.deviceName = deviceName; this.deviceNumber = deviceNumber; }
/// <summary> /// Constructor for Wasapi devices /// </summary> /// <param name="deviceType"></param> /// <param name="deviceName"></param> /// <param name="mmDevice"></param> public AudioOutput(AudioOutputs.AudioDeviceType deviceType, string deviceName, NAJAudio.CoreAudioApi.MMDevice mmDevice) { this.deviceType = deviceType; this.deviceName = deviceName; this.mmDevice = mmDevice; }
/// <summary> /// Constructor for Asio Devices /// </summary> /// <param name="deviceType"></param> /// <param name="deviceName"></param> public AudioOutput(AudioOutputs.AudioDeviceType deviceType, string deviceName) { this.deviceType = deviceType; this.deviceName = deviceName; }