I'm a newbie to working with sounds and I'm coding a VoIP-like system in Python using sounddevice and VB-Audio Cable, where two parties (a computer and a human) talk over the internet. What happens in each round of voice interaction is:
- first, an audio file (wav format, sample rate 22050Hz) in my local computer is played through the microphone using VB-Audio Cable
- the sound is then piped to a VoIP system, which sends it to the phone of a human
- the human hears the sound and responds via his/her phone, and the sound is routed back to my computer via the VoIP system
- using VB-Audio Cable, the sound is played through the mic of my computer
- an ASR (automatic speech recognition) system, working at 16000Hz, picks up the sound and does its work. Based on the results, the system decides what audio file to play next and hence a new round of interaction begins
My goal is to minimize the latency related to Windows audio drivers. By default my Windows machine uses MME for VB-Audio Cable, which I believe is much slower compared to WASAPI and ASIO. So I'm now trying to use either WASAPI or ASIO to see if it can help reduce latency. But I'm facing some issues. For WASAPI, I tried using exclusive mode, but got an error "Error opening InputStream: Invalid sample rate [PaErrorCode -9997]" with sounddevice. For ASIO, I installed ASIO4ALL but I'm having some trouble understanding how to configure things properly. So I'm a bit lost on how to proceed.
What are the things that I need to do in order to use WASAPI or ASIO correctly? Am I making some obvious mistake somewhere? Any help or guidance is greatly appreciated.