Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem Texttospeech python final.ext.raw sous Raspi3/debian #1731

Open
lucarnet opened this issue Mar 23, 2025 · 1 comment
Open

Problem Texttospeech python final.ext.raw sous Raspi3/debian #1731

lucarnet opened this issue Mar 23, 2025 · 1 comment

Comments

@lucarnet
Copy link

Hello,
I'm testing text to speech (test_speaker.py).
2 problems:

  1. Cannot open config mfcc.conf:Solution copying conf/mfcc.conf to the "example" directory fixes the problem (is this normal?)
  2. Error opening input stream /home/pi/dev/vosk/vosk-api/python/example/final.ext.raw: No solution
    The problem is created when executing "rec.SetSpkModel(spk_model)"

What's my mistake?
Environment:Raspi3B+/debian11 Python 3.9.2
Thanks.

Probleme mfcc.conf:

pi@pi3:~/dev/vosk/vosk-api/python/example $ python test_speaker.py test.wav
vosk-model-small-en-us-0.15.zip: 100%|█████████████████████████████████████████████████████████████████████████████| 39.3M/39.3M [00:13<00:00, 2.97MB/s]
LOG (VoskAPI:ReadDataFiles():model.cc:213) Decoding params beam=10 max-active=3000 lattice-beam=2
LOG (VoskAPI:ReadDataFiles():model.cc:216) Silence phones 1:2:3:4:5:6:7:8:9:10
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components.
LOG (VoskAPI:ReadDataFiles():model.cc:248) Loading i-vector extractor from /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/ivector/final.ie
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():model.cc:282) Loading HCL and G from /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/graph/HCLr.fst /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/graph/Gr.fst
LOG (VoskAPI:ReadDataFiles():model.cc:308) Loading winfo /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/graph/phones/word_boundary.int
ERROR (VoskAPI:ReadConfigFile():parse-options.cc:463) Cannot open config file: /home/pi/dev/vosk/vosk-api/python/example/mfcc.conf
Traceback (most recent call last):
  File "/home/pi/dev/vosk/vosk-api/python/example/test_speaker.py", line 27, in <module>
    spk_model = SpkModel(SPK_MODEL_PATH)
  File "/usr/local/lib/python3.9/dist-packages/vosk/__init__.py", line 138, in __init__
    raise Exception("Failed to create a speaker model")
Exception: Failed to create a speaker model
pi@pi3:~/dev/vosk/vosk-api/python/example $ 

Problem final.ext.raw:

pi@pi3:~/dev/vosk/vosk-api/python/example $ python test_speaker.py test.wav
LOG (VoskAPI:ReadDataFiles():model.cc:213) Decoding params beam=10 max-active=3000 lattice-beam=2
LOG (VoskAPI:ReadDataFiles():model.cc:216) Silence phones 1:2:3:4:5:6:7:8:9:10
LOG (VoskAPI:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes.
LOG (VoskAPI:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components.
LOG (VoskAPI:ReadDataFiles():model.cc:248) Loading i-vector extractor from /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/ivector/final.ie
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (VoskAPI:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (VoskAPI:ReadDataFiles():model.cc:282) Loading HCL and G from /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/graph/HCLr.fst /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/graph/Gr.fst
LOG (VoskAPI:ReadDataFiles():model.cc:308) Loading winfo /home/pi/.cache/vosk/vosk-model-small-en-us-0.15/graph/phones/word_boundary.int
ERROR (VoskAPI:Input():kaldi-io.cc:756) Error opening input stream /home/pi/dev/vosk/vosk-api/python/example/final.ext.raw
Traceback (most recent call last):
  File "/home/pi/dev/vosk/vosk-api/python/example/test_speaker.py", line 27, in <module>
    spk_model = SpkModel(SPK_MODEL_PATH)
  File "/usr/local/lib/python3.9/dist-packages/vosk/__init__.py", line 138, in __init__
    raise Exception("Failed to create a speaker model")
Exception: Failed to create a speaker model
pi@pi3:~/dev/vosk/vosk-api/python/example $
@nshmyrev
Copy link
Collaborator

You need to download speakerid model, it is in the model list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants