hundreds-smartphone-3934
10/28/2025, 11:26 AMtall-airline-16756
10/28/2025, 11:26 AMtall-airline-16756
10/28/2025, 11:26 AMrtc.AudioStream class, which lets you tap into the raw audio stream from a participant’s track. This way, you can process audio frames in real-time or collect them for later use.
Here’s a simple overview to guide you:
• Access Raw Audio: Listen for the on_track_subscribed event to know when an audio track is published. Then, wrap the track with rtc.AudioStream to start working with AudioFrame objects.
• Buffer and Convert: Gather frames over the time you need, and then use combine_audio_frames along with to_wav_bytes to create a WAV file that your STT model can understand.
• Custom STT Integration: You can override the stt_node in your agent to send audio directly to your custom STT model. Alternatively, the standalone streaming interface with push_frame lets you handle real-time audio processing smoothly.
This method should work well with most STT models and gives you great flexibility in handling audio. If you’d like, I’m here to help with more details or provide some example code—just let me know!
Sources: Pipeline nodes and hooks | LiveKit Docs | An open source stack for real-time multimodal AI | AI Agents Framework | livekit/livekit_composite | DeepWiki | Capturing the First Few Seconds of a Call for Processing | Speech-to-text (STT) models | LiveKit Docs