I have 2 sound cards I have to take inputs from, process it and feed to the output of the third card. I assume that sounddevice
lib is the best option for that purpose because it directly works with numpy
arrays which are extremely comfortable to work with. But there are two issues I've met by now:
1. I can't understand how to connect to 2 (and more) inputs from different cards in one stream (or may be it is possible to open multiple streams)
2. When trying to start an output stream with predefined device I get an error:
def callback(indata, outdata, frames, time, status):
outdata[:, 1] = data
with sd.Stream(device = 1, channels=2, callback=callback):
print(' ')
sounddevice.PortAudioError: Error opening Stream: Invalid number of channels [PaErrorCode -9998]
I suppose that's because of Core Audio channel mapping on my MacBook, which has these audio config:
0 Built-in Input, Core Audio (2 in, 0 out)
1 Built-in Output, Core Audio (0 in, 2 out)
But I can not beat that problem myself.
Thanks in advance