Giter Club home page Giter Club logo

Comments (8)

chenguoguo avatar chenguoguo commented on June 27, 2024

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!

from snowboy.

tiny-tinker avatar tiny-tinker commented on June 27, 2024

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.

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

@nomadic-squirrel could you let me know if this was fixed eventually? If yes how did you fix it? Thanks!

from snowboy.

tiny-tinker avatar tiny-tinker commented on June 27, 2024

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 :(

from snowboy.

cjolif avatar cjolif commented on June 27, 2024

I've got similar error on Raspberry with the C++ sample.

Fail to open PortAudio stream, error message is "Invalid sample rate"
Listening... Press Ctrl+C to exit

and nothing works.

ALSA description of my microphone is:

Name                        = USB PnP Sound Device: Audio (hw:1,0)
Host API                    = ALSA
Max inputs = 1, Max outputs = 0
Default low input latency   =   0.0087
Default low output latency  =  -1.0000
Default high input latency  =   0.0348
Default high output latency =  -1.0000
Default sample rate         = 44100.00
Supported standard sample rates
 for half-duplex 16 bit 1 channel input =
	44100.00, 48000.00

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

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.

from snowboy.

sriranjanr avatar sriranjanr commented on June 27, 2024

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?

from snowboy.

chenguoguo avatar chenguoguo commented on June 27, 2024

@sriranjanr There are usually two options:

  1. Try another microphone

  2. Try the arecord demo: https://github.com/Kitt-AI/snowboy/blob/master/examples/Python/demo_arecord.py

from snowboy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.