Speech recognition is an awesome thing to do, be it on Linux or any other platform. Sadly, of late, google has restricted its speech recognition APIs because of which speech recognition has become a tedious task for the developers to implement. I started exploring the alternatives for the same and found CMU pocketsphinx as a good alternative. The best part is, it can work offline !. Unfortunately, setting up the software wasn't a cake walk. I worked 10+ hours straight on this and when I was about to give up it finally started working.
So here I surmise the result of the amount of caffeine I had!!
Download PocketSphinx zip file from here
SphinxBase - It comprise of all the libraries that are needed by PocketSphinx
PocketSphinx- He is the guy whom we are after!
unzip pocketsphinx_master.zip
Everything went well till now?! Your system is awesome !!
Now for the big part, to check whether it is gonna work.
before that, open ~/.bashrc, append the line export LD_LIBRARY_PATH=/usr/local/lib/ to the bottom of the file, save, and close it!
/usr/local/bin/pocketsphinx_continuous -adcdev plughw:0,0 -agc none -inmic yes
No crash? working? Your system deserves a medal!
Okay now as you can see, you can say something and the program detects your words. Tinker around and have fun
Sample Output:
Error in compiling? Program crashes? please write your queries in the comment
Meanwhile, I'm working on something really cool with this, keep checking the blog for more info. So until next time, adios!
So here I surmise the result of the amount of caffeine I had!!
1. So first things first, Download pocketsphinx package and its dependent libraries.
Download SphinxBase zip file from hereDownload PocketSphinx zip file from here
SphinxBase - It comprise of all the libraries that are needed by PocketSphinx
PocketSphinx- He is the guy whom we are after!
2. Place them in a folder and extract them
unzip sphinxbase_master.zipunzip pocketsphinx_master.zip
3. Install SphinxBase
- cd sphinxbase_master and run the following commands
- ./autogen.sh
- In the logs, check if checking alsa/asoundlib.h usability... yes, if its not yes, then run sudo apt-get install libasound2-dev and run ./autogen.sh again.
- ./configure
- make
- sudo make install
4. Install pocketsphinx
- cd pocketsphinx_master and run the following commands
- ./autogen.sh
- ./configure
- make clean all
- make check
- sudo make install
Everything went well till now?! Your system is awesome !!
Now for the big part, to check whether it is gonna work.
before that, open ~/.bashrc, append the line export LD_LIBRARY_PATH=/usr/local/lib/ to the bottom of the file, save, and close it!
5. Now, the finale!
Open a new terminal and run the below command!/usr/local/bin/pocketsphinx_continuous -adcdev plughw:0,0 -agc none -inmic yes
No crash? working? Your system deserves a medal!
Okay now as you can see, you can say something and the program detects your words. Tinker around and have fun
Sample Output:
Error in compiling? Program crashes? please write your queries in the comment
Note: Sometimes it's inaccurate in detecting the actual words spoken, there are a lot of parameters involved as to why this happens,. But Hi, I have it all worked out to make it amazingly accurate. Curious? What's life without a suspense :-)! wait for my next post!
Meanwhile, I'm working on something really cool with this, keep checking the blog for more info. So until next time, adios!