Portaudio select input device for capturing
Portaudio select input device for capturing
I face some problems with set up input device for portaudio.
I have 2 cards 0 and 1, and I want to configure:
card 0 for capturing, card 1 for playing.
So, I edit asound.conf
like this:
asound.conf
pcm!.default
type asym
playback.pcm "plughw:1"
capture.pcm "plughw:0"
I realize portaudio can not record audio file, it's always 0 byte in record file. In case of doesn't have asound.conf
in path /etc/, Portaudio works fine. So, my question is:
How can I choose input device for portaudio between 2 cards?
asound.conf
Attached is my cards:
enter image description here
1 Answer
1
You could use Pa_GetDeviceCount() and Pa_GetDeviceInfo() to iterate and list your devices. There is an example for doing so here, the one named pa_devs.c.
With this example you can identify the index of the device and use it depending on your needs.
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.