KoljaB / RealtimeSTT

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

transcribing multiple audio streams simultaneously #63

Open jacobtang opened 3 months ago

jacobtang commented 3 months ago

@KoljaB Hello, I'd like to ask if a single AudioToTextRecorder object supports transcribing or recording multiple audio streams simultaneously? How can I implement simultaneous transcribing or recording multiple audio streams? Thank you!

Ellypax commented 3 months ago

Hello, I'm facing the same issue. I tried using AudioToTextRecorder instances but I have this issue error Error initializing main faster_whisper transcription model: CUDA failed with error initialization error Then I tried editing RealtimeSTT library to declare faster_whisper model as an instance variable but when I try to process the second audio stream the application freeze and stop processing every request. I would appreciate help with that. Thank you !

KoljaB commented 3 months ago

faster_whisper can do that in principle, please look here. The parameter needed in RealtimeSTT is gpu_device_index, which maps directly to faster_whisper's device_index. So for parallel transcriptions you would need to have multiple GPUs. You can try using multiple AudioToTextRecorder instances with multiple different gpu_device_index parameter values, but I have not tested this (I only have a single GPU).