This project has moved. For the latest updates, please go here.

Wavein on input device which is not set as default

Jan 9, 2014 at 8:08 AM
I would like to check on all available devices whether they provide any valid sound or not.
But at this moment I'm only able to check a device's input when it is set as default one.

Here's my code
            Dim recordingFormat As New NAudio.Wave.WaveFormat(44200, 16, 1)
            wvInStream = New NAudio.Wave.WaveIn()
            wvInStream.DeviceNumber = _AudioDevicePort
            wvInStream.WaveFormat = recordingFormat
            wvWriter = New NAudio.Wave.WaveFileWriter(System.IO.Stream.Null, wvInStream.WaveFormat)
            AddHandler wvInStream.DataAvailable, AddressOf ThereIsDataNoticed

The handler just checks the validity of the sound.
Jan 9, 2014 at 8:09 AM
The _AudioDevicePort is equal to the ID of the device which is determined in the combobox with a list of all available sound devices on the pc.
Jan 10, 2014 at 12:52 PM
Edited Jan 10, 2014 at 12:52 PM
44200 is not a standard sample rate. You should use 44100.
Also, not sure what you mean by validity?
Jan 15, 2014 at 10:09 AM
OK changed it to 44100.

I'm now able to determine the sound and check if there is a valid sound ( no noise ) on the input.