aiXander / Realtime_PyAudio_FFT

Realtime audio analysis in Python, using PyAudio and Numpy to extract and visualize FFT features from streaming audio.
MIT License
955 stars 185 forks source link

sounddevice.PortAudioError: Error querying device -1 #27

Open JyunYiWu-0218 opened 1 year ago

JyunYiWu-0218 commented 1 year ago

Following the README.md operation will run out of this error: Traceback (most recent call last): File "/home/junyiwu/Realtime_PyAudio_FFT/Realtime_PyAudio_FFT/run_FFT_analyzer.py", line 4, in ear = Stream_Analyzer( File "/home/junyiwu/Realtime_PyAudio_FFT/Realtime_PyAudio_FFT/src/stream_analyzer.py", line 51, in init self.stream_reader = Stream_Reader( File "/home/junyiwu/Realtime_PyAudio_FFT/Realtime_PyAudio_FFT/src/stream_reader_sounddevice.py", line 52, in init with sd.InputStream(samplerate=self.rate, File "/home/junyiwu/.local/lib/python3.10/site-packages/sounddevice.py", line 1381, in init _StreamBase.init(self, kind='input', wrap_callback='array', File "/home/junyiwu/.local/lib/python3.10/site-packages/sounddevice.py", line 777, in init _get_stream_parameters(kind, device, channels, dtype, latency, File "/home/junyiwu/.local/lib/python3.10/site-packages/sounddevice.py", line 2571, in _get_stream_parameters info = query_devices(device) File "/home/junyiwu/.local/lib/python3.10/site-packages/sounddevice.py", line 569, in query_devices raise PortAudioError('Error querying device {0}'.format(device))

want to know how to improve Ubuntu 22.04.1

Flying3voveU commented 11 months ago

I had the same problem. But at the top of the terminal, it was saying that "No working microphone devices found!". So I checked my microphone settings and I found that I had no microphone enabled. I enabled Realtek(R) Audio in microphone section and then it worked!