Closed Goddard closed 1 year ago
Hi @messiaen! Sorry for late response.
A streaming_response_generator()
can take any iterable of audio chunks. It is not necessary an iterator.
If you get a huge chunk of audio as input, then you may split it. This repo provides ways тo split audio from files and a microphone.
I think you meant me, but let me elaborate. A websocket receives a raw audio stream. This is just raw audio data and it is only "bytes". It has no iterator itself. If you try to pass just bytes you get an error. I eventually found a solution using nodejs instead of python, but it would still be cool to see how to get this working using python.
@Goddard If receive your audio in a chunk of bytes
, then it will be simpler to use ASRService.offline_recognize()
. If you still need streaming, then you will need to write some kind of wrapper to make it work.
Closing issue due to lack of activity. Please re-open the issue if you would like to follow up with this issue.
I am attempting to use the streaming_response_generator in a websocket. How does one use this with a websocket where the data is coming in isn't an iterator?