Closed tomanwalker closed 3 years ago
After trying out different combinations - I saw that needed to do
./test_words.py
./test.py test.wav
But then "phrase_list" gets Emptied for every message, need to send "words" again, everytime
I'm experiencing the same issue, and sending "words" again everytime is not a practical solution. The 'words.txt' file already exists in the model repo, so it should use that by default.
Solution found: Send the config command like in ./test_words.py, but don't include "phrase_list" or "words", e.g.:
await websocket.send('''{"config" : {"sample_rate" : 16000.0 }}''')
I've had this error using the Python API, not a websocket though. In my case, this problem was that the model was expecting a 16000hz audio file, and I gave it a 8000hz file
I think it may be possible to resample an 8000hz file to a 16000hz file - obviously you won't actually be gaining any audio data though, but it could fix this error
Alternatively, different models available at https://alphacephei.com/vosk/models accept audio with different sample rates. For example, the model titled "vosk-model-en-us-0.21" accepts audio with an 8000hz sampling frequency as well as some other frequencies (e.g. 44.1khz)
Followed Docs and files from https://github.com/alphacep/vosk-server/tree/master/websocket
Tried first on RPi (2B), then on VM (Lubuntu x64) - same result - frequency mismatch