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.1k stars 191 forks source link

Multiple clients in browser-client code #83

Closed gowthm-r7 closed 4 months ago

gowthm-r7 commented 4 months ago

Hey there, I'm using example_browserclient code by having seperate server and client pc (server.py code in server pc and index.html and client.js code in the client pc). I established the connection by connecting both the PCs in the same internet and hosting the server via server PC's IP address (instead of hosting it to localhost). It is working perfectly.

Can I handle multiple clients? Cos, I tried connecting another client and gave input to it, but got the same output in both the clients, eventhough the other client was set idle and given no input.

KoljaB commented 4 months ago

This is not implemented yet, so it can't handle multiple clients. RealtimeSTT can't do multiple transcriptions in parallel, so for this scenario some way of queueing the requests has to be implemented.

gowthm-r7 commented 4 months ago

in what way? should the other clients wait for the previous client to finish?

KoljaB commented 4 months ago

Yes. Or you need to use multithreading or multiprocessing and probably use multiple gpus. This is due to how the dependent libraries are implemented, can't do much here.