Open fkurushin opened 1 month ago
You try to send mp4 to websocket while it expects raw wav. You need to modify server to handle mp4.
We use AudioContext worklet to record audio instead, you can find example here:
https://github.com/alphacep/vosk-server/tree/master/client-samples/javascript
Overall, we recommend webrtc server for web, not websockets, it is more appropriate approach:
Hi @nshmyrev thank you for the answer. I thought that if server passed the process_chunk
without errors it accepts my request.
def process_chunk(rec, message):
if message == '{"eof" : 1}':
return rec.FinalResult(), True
if message == '{"reset" : 1}':
return rec.FinalResult(), False
elif rec.AcceptWaveform(message):
return rec.Result(), False
else:
return rec.PartialResult(), False
Overall, I will try to convert to audio/wav, than audio context, and webrtc.
I writes react client to recognise speech through web sockets. I am happily connected to the server (
alphacep/kaldi-ru:latest
), send requests there, everything alright, but my responses is empty. Can anyone please take a look at my code?This is client logs:
Any help welcome, thank you!