This project has moved and is read-only. For the latest updates, please go here.

How to get WaveIn DeviceNumber?

Dec 11, 2012 at 8:48 PM

We are using Naudio (1.5) in a C# application. We plug in 3-5 USB microphone in an WIndows 7 machine to make recording. When using WaveIn, we need to give it the index number for the USB devices that plugged in.

waveIn = new WaveIn();

waveIn.DeviceNmber = xxxxx;


My question is: how to get device number for each USB microphone we are using?

Thanks a lot


Dec 12, 2012 at 7:48 AM

You can enumerate the available WaveIn devices using WaveIn.GetCapabilities passing in numbers up to WaveIn.DeviceCount

Dec 12, 2012 at 12:03 PM

Thanks for your reply, so if i do this

         int waveInDevices = WaveIn.DeviceCount;
for (int waveInDevice = 0; waveInDevice < waveInDevices; waveInDevice++)
WaveInCapabilities deviceInfo = WaveIn.GetCapabilities(waveInDevice);
MessageBox.Show("Device " + waveInDevice + ": " + deviceInfo.ProductName +
", " + deviceInfo.Channels + " channels");

the waveInDevice is the devicenumber for each device.

waveIn = new WaveIn();

waveIn.DeviceNmber = waveInDevice;



Dec 12, 2012 at 12:04 PM

that's right. It's an index, and 0 always is your default audio device

Dec 12, 2012 at 12:13 PM


Dec 12, 2012 at 12:33 PM

I plugged 2 USB microphones in front of my machine and 1 in the back. The one in the back (Microphone (3-USB Audio Device) has index 0, so this is the default audio device.