Saturday, February 17, 2018

pocketsphinx, Speech recognition tool

1- install packages
$ sudo apt-get install  pocketsphinx pocketsphinx-en-us

2- convert audio file to wav format
$ ffmpeg  -i inputfile.aac output.wav
$ ffmpeg  -i inputfile.mp3 output.wav

the program need   ono 16000 Hz

so we can use command below
$ ffmpeg -i sphinx.wav -acodec pcm_s16le -ac 1 -ar 16000 out.wav

3- we can use pocketsphinx to recognize the speed the the microphone
 $ pocketsphinx_continuous -hmm   /usr/share/pocketsphinx/model/en-us/en-us  -lm /usr/share/pocketsphinx/model/en-us/en-us.lm.bin -dict /usr/share/pocketsphinx/model/en-us/cmudict-en-us.dict -inmic yes

4- or we recognize from the input file
$ pocketsphinx_continuous -hmm   /usr/share/pocketsphinx/model/en-us/en-us  -lm /usr/share/pocketsphinx/model/en-us/en-us.lm.bin -dict /usr/share/pocketsphinx/model/en-us/cmudict-en-us.dict -infile out.wav  | tee sphinxout

No comments:

Post a Comment