how livekit handles concurrency of multiple users ...
# ask-ai
a
how livekit handles concurrency of multiple users on call with deepgram for speech to text?? where it generates transcirption parallely instead of sequentially?
t
Thanks for reaching out, Hiren. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you help me understand a bit better? Are you asking about LiveKit’s built-in features for handling concurrency with Deepgram, or are you looking for some tips on how to set this up in your own app? Also, are you working with any particular SDKs or APIs for this integration? I’m here to help!
a
Yes you understood it right.. please revert on it like how livekit handles concurrency with deepgram
t
LiveKit makes handling multiple users with Deepgram super smooth by processing each person's audio stream separately. Here’s a quick rundown of how you can set this up: 1. Initialize Deepgram STT: Start by creating a Deepgram STT instance to handle real-time transcription. 2. Track Participant Connections: Keep an eye on LiveKit's events to know when folks join or leave the session. 3. Create Independent Sessions: For every participant, set up a separate session linked to their audio stream so transcription happens side-by-side. 4. Use RoomIO: Connect each session to a participant’s audio track with the RoomIO class, making sure transcription is tailored to that user. 5. Start Transcription: Kick off a transcription stream for each person’s audio input. 6. Clean Up: When someone leaves, close their session and tidy up resources. This way, you get transcriptions running in parallel for everyone without a hitch. If you want me to walk you through the steps in more detail or share some example code, just give me a shout! Sources: How to set a fixed participant for agent audio processing | Deepgram STT integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/tts.py