scottlawsonbc / audio-reactive-led-strip

:musical_note: :rainbow: Real-time LED strip music visualization using Python and the ESP8266 or Raspberry Pi
MIT License
2.67k stars 642 forks source link

Can't use your microphone in VoIP applications if visualization is running. #320

Open NotUnderi opened 3 years ago

NotUnderi commented 3 years ago

Tested with Teamspeak and Discord using an Asus Xonar soundcard. With default microphone being stereo mix for the visualization and using the microphone in discord and teamspeak, the programs can't capture anything. Teamspeak simply says "microphone disabled" and discord doesn't show any activity. Trying to run the python script when the mic is in use in teamspeak throws OSerror

C:\Users\Henrik\Downloads\audio-reactive-led-strip-master\python>python visualization.py Traceback (most recent call last): File "visualization.py", line 356, in microphone.start_stream(microphone_update) File "C:\Users\Henrik\Downloads\audio-reactive-led-strip-master\python\microphone.py", line 14, in start_stream frames_per_buffer=frames_per_buffer) File "C:\Users\Henrik\AppData\Local\Programs\Python\Python37\lib\site-packages\pyaudio.py", line 750, in open stream = Stream(self, *args, kwargs) File "C:\Users\Henrik\AppData\Local\Programs\Python\Python37\lib\site-packages\pyaudio.py", line 441, in init self._stream = pa.open(arguments) OSError: [Errno -9985] Device unavailable

NotUnderi commented 3 years ago

The script works if my default microphone is the same as in teamspeak, but then it will just visualize me speaking so that's a bummer.

joeybab3 commented 3 years ago

I'm not sure if this is an issue with the program necessarily or if this is an issue with discord/windows not playing well with the mic.

I haven't personally experienced this but I know that it uses the default input device for the visualization.

What is your default input device currently?

NotUnderi commented 3 years ago

Might be something to do with my sound card, an Asus Xonar SE. For some reason I can speak in teamspeak and run the visualization if both are using the same microphone. Problems start arising when the script is trying to access stereo mix but I'm using a different mic in a voip program.

If I play music from my speakers, connected to the motherboard sound card, it'll work just fine and I can still speak in teamspeak or discord. I guess the sound card can only have one output available and thus the visualization will fail if trying to use stereo mix when the microphone is being used. I didn't realize this before, sorry for being a bother.