Hello friends,
i am trying to build a french speech recognition app for my desktop.
I downloaded the french accoustic model from source forge website and included them into my code. The code i got from PyPi pocketsphinx page. It works with english model, but i dont know why it didnt work for french model.
Error what i get is :
File "/home/garud/Documents/SpeechRecog/SR_fr.py", line 14, in <module>
dic=os.path.join(model_path, 'fr.dict')
File "/home/garud/anaconda3/lib/python3.7/site-packages/pocketsphinx/init.py", line 208, in init
super(LiveSpeech, self).init(*kwargs)
File "/home/garud/anaconda3/lib/python3.7/site-packages/pocketsphinx/init.py", line 90, in init
super(Pocketsphinx, self).init(config)
File "/home/garud/anaconda3/lib/python3.7/site-packages/pocketsphinx/pocketsphinx.py", line 273, in init
this = _pocketsphinx.new_Decoder(args)
RuntimeError: new_Decoder returned -1</module>
Is some file which is downloaded is wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello friends,
i am trying to build a french speech recognition app for my desktop.
I downloaded the french accoustic model from source forge website and included them into my code. The code i got from PyPi pocketsphinx page. It works with english model, but i dont know why it didnt work for french model.
Below is what i tried:
import os
from pocketsphinx import LiveSpeech
model_path = "pocketsphinx-python/pocketsphinx/model"
speech = LiveSpeech(
verbose=False,
sampling_rate=16000,
buffer_size=2048,
no_search=False,
full_utt=False,
hmm=os.path.join(model_path, 'fr-ca'),
lm=os.path.join(model_path, 'fr-small.lm.bin'),
dic=os.path.join(model_path, 'fr.dict')
)
for phrase in speech:
print(phrase)
Error what i get is :
File "/home/garud/Documents/SpeechRecog/SR_fr.py", line 14, in <module>
dic=os.path.join(model_path, 'fr.dict')
File "/home/garud/anaconda3/lib/python3.7/site-packages/pocketsphinx/init.py", line 208, in init
super(LiveSpeech, self).init(*kwargs)
File "/home/garud/anaconda3/lib/python3.7/site-packages/pocketsphinx/init.py", line 90, in init
super(Pocketsphinx, self).init(config)
File "/home/garud/anaconda3/lib/python3.7/site-packages/pocketsphinx/pocketsphinx.py", line 273, in init
this = _pocketsphinx.new_Decoder(args)
RuntimeError: new_Decoder returned -1</module>
Is some file which is downloaded is wrong?
You need to set verbose=True in the code to see the exact error.