How to give an input wav file to pocket sphinx
Asked Answered
S

1

8

Is there some command line utility of pocket sphinx or cmu sphinx to convert a .wav file to text?

pocketsphinx_continuous -hmm -lm -dict will do. But I don't want to keep speaking the same sentence again and again.

Schmuck answered 30/11, 2013 at 17:7 Comment(0)
T
10

pocketsphinx_continuous starting from version 0.8 has option -infile which you can use to decode a file. File must be in a specific format: 16khz 16bit mono wav file

 pocketsphinx_continuous -infile file.wav
Tice answered 30/11, 2013 at 19:18 Comment(8)
Thanks for your answer. I don't see this -infile argument in man file. Moreover, I get the following error. FATAL_ERROR: "continuous.c", line 153: Failed to calibrate voice activity detection. I have the input file in 8k sample rate. Is that the problem?Schmuck
Yes, if you want to decode 8khz audio file you need to add an option '-samprate 8000'. Also make sure you are using the correct acoustic model for the audio you are trying to decode.Tice
Even with -samprate 8000, i get the same error :( "FATAL_ERROR: "continuous.c", line 153: Failed to calibrate voice activity detection"Schmuck
share the file you are trying to recognizeTice
I had this same problem, and it was solved by creating a larger file, with more silence at the beginning. From what I read in the Sphinx code, it seems that this calibration process is to calibrate what is silence and what isn't. Since I had a very small audio file (only three words, about a second), I deduced it needs more data to "calibrate" the silence.Sepulveda
In recent versions this issue was fixed, you don't need to add silence anymore.Tice
This hasn't worked for a long time. You need to specify an acoustic model.Calumniation
If models are properly installed, you do not need to specify the model path on Linux. On Windows you always need to specify the path since there is no "installation" step there.Tice

© 2022 - 2024 — McMap. All rights reserved.