Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sounddevice.PortAudioError: Error querying device -1 #27

Open
JyunYiWu-0218 opened this issue Apr 26, 2023 · 1 comment
Open

sounddevice.PortAudioError: Error querying device -1 #27

JyunYiWu-0218 opened this issue Apr 26, 2023 · 1 comment

Comments

@JyunYiWu-0218
Copy link

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
Copy link

Flying3voveU commented Oct 22, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants