5

I installed pocketsphinx in my Linux machine correctly, and now I want to convert an audio file (.wave) to text by using pocketsphinx,how can i do that? is there any clear command and short command to do that? somthing like this command:

  ./src/programs/pocketsphinx_continuous -samprate 8000 -nfft 2048 -adcdev hw:1,0 -lm 2530.lm -dict 2530.dic myvoice.wav 

and also how can I do that with using python? Thanks in advance.

Ali
  • 602
  • 6
  • 18

1 Answers1

6

I find my answer, pocketsphinx with version 0.8 has an option that can do that:

pocketsphinx_continuous -infile myfile.wav 

however file must be in a specific format: 16khz 16bit mono wav file

Ali
  • 602
  • 6
  • 18
  • 4
    ERROR: "acmod.c", line 80: Acoustic model definition is not specified either with -mdef option or with -hmm ... it suddenly became a whole lot more complex... – Mike Jan 24 '17 at 21:33
  • 3
    Anyone experiencing the same issue as Mike on an Ubuntu based machine should try installing pocketsphinx-en-us package with apt install. – Anthony Hiscox May 06 '18 at 01:43
  • 4
    You can convert an mp3 to the correct wave format using: ffmpeg -i yourfile.mp3 -acodec pcm_s16le -ac 1 -ar 16000 myfile.wav – Anthony Hiscox May 06 '18 at 01:47