WASAPI sample rate issues

Hey everyone.

I’m working on an interactive audio app and I’m trying to use the WASAPI drivers (as opposed to DirectSound) to get good performance.
One problem I’ve noticed, though, is that you can’t open a full-duplex WASAPI audio device in Juce unless the input and output sample rates match in the Control Panel.
My app is targeting users who probably won’t know how to access those settings, so I’m trying to make it work even if the sample rates are different.
Anyone dealt with this issue before? Jules, any plans to handle this case?

Here are some strategies I thought of:

  • Change the WASAPIAudioIODevice classes (inside JUCE) so that one AudioIODevice can have different sample rates for input and output, and one is resampled to match the other somehow. The buffering would be tricky.
  • Have two different AudioDeviceManagers in my app, each of which handles only input or output, and try my best to synchronize them somehow with my app code.

Any thoughts, suggestions, ideas appreciated.

+1, i’m in same boat

Why WASAPI ? It’s only available in Vista and 7 (not XP) and it’s seems to be not as good as ASIO …

Typically consumer audio devices, like the built in audio on laptops or desktop motherboards, ship with WASAPI drivers but not ASIO.

True, but installing asio4all isn’t too chalenging, even for the end user, is it ? :slight_smile:

Never overestimate the end user!

I’ve used Asio4All myself, and I love it. But unfortunately, our app is targeting novice-level users, and we can’t expect that all of them will know how (or want) to install Asio4All.
Thanks.

It’d be a bit of a nightmare to implement a driver that can sync two separately-running devices with different sample rates, though it’s something I’ve thought about.

Since Windows 8, WASAPI will do SRC for you, enabling using input and output devices with mismatching native rates. Here’s a patch to enable it: