Open James9760 opened 2 years ago
It is a sample rate issue, you need to configure sample rate with a config message probably.
I have to send sample rate parameter in php file same as done in python script
await websocket.send('''{"config" :
{ "phrase_list" : ["zero one two three four five", "six seven eight nine oh"],
"sample_rate" : %d,
"words" : 0}}''' % (wf.getframerate()))
asr_server.py
args.interface = os.environ.get('VOSK_SERVER_INTERFACE', '0.0.0.0')
args.port = int(os.environ.get('VOSK_SERVER_PORT', 2700))
args.model_path = os.environ.get('VOSK_MODEL_PATH', 'model')
args.spk_model_path = os.environ.get('VOSK_SPK_MODEL_PATH')
args.sample_rate = float(os.environ.get('VOSK_SAMPLE_RATE', 8000))
args.max_alternatives = int(os.environ.get('VOSK_ALTERNATIVES', 0))
args.show_words = bool(os.environ.get('VOSK_SHOW_WORDS', True))
by default sample rate is set to 8000
I'm running this code in vosk-server/client-samples/php/asr-test passing the same file that i am passing to python client but this file is not returning correct output it is different from the output that i have got with python script.
Output :
{ "partial" : "" } { "text" : "" }
python output :
{"result": [{"conf": 0.584788, "end": 5.039281, "start": 4.86, "word": "test"}, "test"]}