leaving pyaudio stream open

I have four microphones, and I am currently working on determining the direction of arrival for sound. I am writing the code in Python on a MacBook. The problem arises when I run a test code to measure amplitude; I only receive inputs from two microphones, while the other two show an amplitude of 0. In the code, I use threading to record in parallel and keep the PyAudio stream open until the end, instead of closing it after each recording session. Previously, when I would open and close the stream for each recording, all four microphones worked. How can I solve the issue of the two microphones not recording anything? By the way, there is nothing wrong with the microphones or the ports. I have also tried using the sounddevice library. I appreciate the help
12 Replies
Strike
Strike11mo ago
I'd be cool if we could get some code. Apart from that did you check drivers are working ok?
Darth Vader
Darth VaderOP11mo ago
Yeah
Darth Vader
Darth VaderOP11mo ago
Darth Vader
Darth VaderOP11mo ago
this is the test code i am running.
Strike
Strike11mo ago
What output do you get?
Darth Vader
Darth VaderOP11mo ago
No description
Strike
Strike11mo ago
Also there seems to be only 3 microphones In your code
Darth Vader
Darth VaderOP11mo ago
the set3 is the mic that is not working. i removed a mic to see if there would be any change
Strike
Strike11mo ago
Also are you taking into account that there is delay? I'm presuming you are If you put the device as only set3 does it work?
Darth Vader
Darth VaderOP11mo ago
yes if they are either one or two mics, the code is working. the conclusion i could arrive on is that there is a hardware restriction or pyaudio doesnt support multiple streams being opened for long time at all.
Strike
Strike11mo ago
Have you tried a callback based approach?
Darth Vader
Darth VaderOP11mo ago
I partially tried it but that was just limited to frames.
Want results from more Discord servers?
Add your server