-
Notifications
You must be signed in to change notification settings - Fork 994
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
IOError: [Errno -9997] Invalid sample rate #14
Comments
Hi, regarding changing the sampling rate, Snowboy requires a specific sampling rate which you can see by calling the SampleRate() function. For now it's 16k. You can use different sampling rate for PyAudio, but when you feed the data to Snowboy detector, you will have to convert the data to 16k sampling rate. As for the "Invalid sample rate" error, there's a long discussion in this thread. It might has something to do with pulseaudio. Some people mentioned that they were able to fix the issue by using a fresh installation of the OS. You can go through the thread to see what's the best fix. Please do let us know if you end up with a nice solution to the issue! |
Ok, thanks for the update. For now I started new with a fresh image of Raspbian jesse. If I run into this issue there, I'll dig further. I was doing a lot with installing libraries and messing with the microphone, so maybe something got whacky in that. |
@nomadic-squirrel could you let me know if this was fixed eventually? If yes how did you fix it? Thanks! |
Yea, I just tested it. I still get the same ALSA warnings, then I get this output: ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Listening... Press Ctrl+C to exit
INFO:snowboy:Keyword 1 detected at time: 2016-08-05 18:27:15 And it will detect if I speak directly into the mic. I think I futzed around with my alsa settings and fubard something along the lines. This is a mostly fresh image with just the development libraries and snowboy installed. So, not terribly helpful, sorry :( |
I've got similar error on Raspberry with the C++ sample.
and nothing works. ALSA description of my microphone is:
|
Snowboy requires a sample rate of 16k, it could be that the 16k sampling rate is not supported by your microphone. If you have other microphones by hand, you can give them a try. |
I am having the same invalid sample rate issue, The sample rate support by my USB mic is 44100. So where and how should I set the sample rate? |
@sriranjanr There are usually two options:
|
Hey guys!
Great stuff! This is pretty much exactly what I was trying to build! But you guys are way further than I ever would have gotten. Er, but I didn't get very far.
I'm running this on a raspberry pi model B with a Cyber Acoustics USB microphone. I can successfully record something using
AUDIODEV=hw:1,0 rec t.wav
.Anyway, when attempting the demo with this command:
I get a bunch of garbage from ALSA that is apparently just warnings. But the last bit dumps this:
I saw this while playing with another voice recognition and I was able to get past it by passing a sample rate. Is there an easy way to pass sample rate to your decoder?
For reference, here is the get_device_count dump:
Output: (formatted for reading!)
The text was updated successfully, but these errors were encountered: