This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Harsh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're exploring how to pass PCM 48K audio data from your third-party WebSocket to a LiveKit room! To help you along, you can use LiveKit’s server SDKs to publish PCM16 samples directly. Here’s a simple overview to get you started: 1. Create a PCMLocalTrack: You’ll want to use the
NewPCMLocalTrack
API in the Go SDK, setting the sample rate to 48000 Hz and using a mono channel. 2. Write PCM16 Samples: If needed, convert your WebSocket PCM data to PCM16 format, then write it to the track using
WriteSample
. 3. Handle WebSocket Data: Make sure your PCM data is in
pcm_s16le
format (that’s 16-bit signed little-endian) and sampled at 48kHz. If your data is base64 encoded, don’t forget to decode it first. 4. Close the Track: When your audio stream ends, simply call
Close()
on the track to wrap things up properly. If you’d like, I’m here to provide detailed code examples or help you with a specific SDK—just let me know! I’m happy to support you every step of the way. Sources: livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/stt.py | examples/openai_realtime_voice/realtime_api_handler.go