alexa-pi / AlexaPi

Alexa client for all your devices! # No active development. PRs welcome # consider https://github.com/respeaker/avs instead
MIT License
1.33k stars 396 forks source link

How to set sample rate? #198

Open derkalaender opened 7 years ago

derkalaender commented 7 years ago

My RaspberryPi 2 Model B doesn't do anything when I say "Alexa". I figured out why: the recording I get when running arecord -D hwplug:Device,0 test.wav sounds horrible. I assume it's because of the low sample rate (when I'm doing arecord -r 96000 -D hwplug:Device,0 test.wav it sounds normal).

So how do you change the sample rate AlexaPi records with?

Btw: I'am using this mic and when using it on my windows pc it works perfectly fine.

renekliment commented 7 years ago

Hey!

  1. AlexaPi uses the sample rate of 16 kHz and you can't currently change that. It uses the plughw: devices, where ALSA does sample rate conversion automatically, there should be no issue.
  2. My RaspberryPi 2 Model B doesn't do anything when I say "Alexa".

    This doesn't have to be the case - voice triggering can be tricky in a lot of ways.

  3. Try running in debug mode, triggering it with a button, keypress or something else and record something. Then, upload your recording.wav, which will be in /tmp/AlexaPi-runtime-something.
derkalaender commented 7 years ago

OK. I seem to be able to trigger the hotword when I'm shouting Alexa, but the quality it records my voice with is still terrible. Here is the recording.wav

delphiki commented 7 years ago

I have the exact same problem (RPi 2, same mic). I managed to get it working properly once, but no success since.