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

Compatible bit rates #226

Closed
vondeckerstein opened this issue Oct 18, 2014 · 3 comments
Closed

Compatible bit rates #226

vondeckerstein opened this issue Oct 18, 2014 · 3 comments

Comments

@vondeckerstein
Copy link

So far with three different USB input devices(one USB microphone, two USB soundcards) I am unable to get jasper to work. I have confirmed in the python interpreter (with a pyaudio instance) that each device supports a bitrate of 44100 or 48000, but not the jasper default 16000.

Running it without editing mic.py causes an error:
File "/usr/lib/pymodules/python2.7/pyaudio.py", line 714, in open
stream = Stream(self, _args, *_kwargs)
File "/usr/lib/pymodules/python2.7/pyaudio.py", line 396, in init
self._stream = pa.open(**arguments)
IOError: [Errno Invalid sample rate] -9997

Increasing the rate in mic.py to 48000(and the chunk to 4096) causes an error:
File "/home/pi/jasper/client/mic.py", line 117, in passiveListen
data = stream.read(CHUNK)
File "/usr/lib/pymodules/python2.7/pyaudio.py", line 564, in read
return pa.read_stream(self._stream, num_frames)
IOError: [Errno Input overflowed] -9981

out of the three devices, one defaults to 48000 so i suspect it should work. what am i doing wrong?

@Holzhaus
Copy link
Member

Can you please run Jasper with --debug and post the complete output?

@vondeckerstein
Copy link
Author

I ended up getting it working late last night, by adding ' input_device_index=3, ' to each instance in mic.py where the stream is opened.

For what it's worth, I made a list of devices available to pyaudio:
0:USB PnP Sound Device: USB Audio (hw:0,0)
3:sysdefault
7:spdif
9:default

I'm not sure what 'sysdefault' is but it listed that it could handle up to 128 input devices, so i'm guessing something in software. Might be an option for others who can't get it to work on multiple devices.

Thanks anyway!

@Holzhaus
Copy link
Member

Thanks to #247 (which was merged into the v2.0 dev branch), audio devices will soon be configurable. Closing.

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