KoljaB / RealtimeSTT

A robust, efficient, low-latency speech-to-text library with advanced voice activity detection, wake word activation and instant transcription.
MIT License
2.09k stars 190 forks source link

STT as a Websocket (server side) #105

Closed she7ata7 closed 3 months ago

she7ata7 commented 3 months ago

I want to create the STT to act as server(To receive audio chunks and send back the full sentence to the client) using websocket and I found this example here: Sockect Example

How do I handle multiple clients at the same time? For example client_1 and client_2 are connected and sending audio chunks at the same time so maybe we will face a collision problem here between the chunks of both, because I'm using the same method call feed_audio to feed the STT

KoljaB commented 3 months ago

You'd need to queue the requests or start multiple RealtimeSTT instances. The underlying model (whisper) does not allow concurrent requests.