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

Is there a way to select/switch sample rates of a USB device with naudio?

Mar 23, 2016 at 2:26 PM
Edited Mar 23, 2016 at 2:36 PM
First, this is NOT a question about sample rate conversion. It is about programmatically selecting the sample rate and bit depth of a USB sound device as one could do manually through the Windows sound dialog on the Advanced tab (see jpeg). I have a need to create a .NET app that, hopefully, could use naudio to play wav files using wasapi and be able to switch the sample rate before playing the next wav file. I would also like to be able to select a USB device from the list of available devices, as the USB devices themselves will be added and removed from the list of available devices (by means such as changing the device product ID done by a separate process that's already worked out).

Is it possible to do this with naudio? If not, does anyone know any way to do this?

Image
Coordinator
Mar 26, 2016 at 10:16 AM
If you open a WASAPI device in exclusive mode then you can specify the sample rate the device uses.
I don't know any other way to do this, but maybe if you browse the WASAPI documentation you can find something.