I have been experimenting with the Raspberry Pi and creating an offline voice recognition bot to recognize the numbers 0 through 9. The software I am using to accomplish this task so far is SOPARE, however I have been less than successful (spotty at best results when trying to recognize numbers, just guesses random variables). Next up is for me to try out Jasper Project, however I don't know if i'll be successful there either. If anyone has any suggestions on what I could use, I would greatly appreciate it.

A few notes on what I am working on (and it's constraints):

  1. It has to be functional without an internet connection.
  2. It has to function with just the RasPi (No other chips that I have to go out and purchase)
  3. Program has to be easily re-programmable, (i.e if I need to add more vocabulary I can train it rather easily)

What would be ideal for me would be a voice recognition software that comes pre-programmed to recognize basic numbers (Or can learn them easily)

I greatly appreciate the help.

Best, -Andrew

3 Answers 3


As above, I am using the same USB UGREEN "SOUNDCARD" as the RPi boards do not have a microphone jack or interface-- regardless of how you want to look at it.

Getting the right microphone was very key. I had great success with a 3.5mm jack omnidirectional conference microphone. (I had a less happy experience with a clip on lapel microphone that I basically had to yell at before the audio could be interpreted by the software.)

I had better results when I made use of /dev/shm for speedier IO.

I liked PocketSphinx on the RPi best.

Tweak and/or thin the entries of the dict file to make things go faster. By limiting the amount of words it can recognize, I made the best performance gains. https://raw.githubusercontent.com/cmusphinx/cmudict/master/cmudict.dict

Yeah, that is more or less it. Good luck.

A light warning: /dev/shm is not necessarily a magic bullet-- but, you're using it for a lot of the audio purposes that pulse audio uses /dev/shm for. So, read up on /dev/shm, be smart about what you stuff in /dev/shm, ???, profit.



Rpi offline voice recognition of numbers 0 through 9

No Internet connection, no extra chips

Programmable, eg extend vocabulary

Any suggestions?


Well, can I assume you already have USB microphone or similar? And since Rpi has not analog to digital, it is impossible to sample and convert voice analog signal.

So I think at least you need some cheap voice input, like the US$2 microphone and power amplifier module below.

And another US$2 for an ADC chip, such as MCP3208 12 bit ADC.

So the ridiculously small budget of 5 dollars is good enough for your ridiculously small vocab voice recognition project.

Microphone module

Rpi USB Sound Card

First, some brainstorming ideas.

  1. Loop a continuous moving average of 100mS to detect start sound trigger signal.

  2. As soon as sound detected, start MCP3208 to sample voice and do ADC, and stored in RAM and also SD card, say for 1 to 2 seconds, or stop as soon as the moving average goes dead.

  3. The sample size for a couple of seconds is small, and you can always take less samples per second. Or do some cheating, small sample when user speak first time, pretend not clear, and heavy sample on user's next try.

  4. Use simple structured, sequential, statistical analysis tools (DIY or googled) to compare and contrast the 10 (0 to 9) trained samples,

  5. Can use Python multiprocessing module to compare input data points with 10 standard templates at the same time, discard hopeless templates as soon as possible.

/ to continue,


Recording sound with Rpi and ADC

Using Rpi USB microphone as audio input

Rpi USB sound card recording noise problem

MCP3008 SPI, 10 bit, 200kps Datasheet - MicroChip

How to amplify voice from microphone in real time? - Old Rpi StkEx post

How to make one MCP3008 A/D conversion? - Old Rpi StkEx post

Differences Between 16-Bit and 24-Bit Audio - Wesley Fenlon 2011mar03

MCP3201/04/08 12bit ADC Datasheets - Microchip


wblgers on GitHub shows a pretty easy way to setup your own 0-9 speech recognition using a Hidden Markov Model. https://github.com/wblgers/hmm_speech_recognition_demo

Check back soon on my page I'll have speech recognition soon using image recognition. https://github.com/DanielsKraus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.