I want to stream some audio from redis, instead of...
# ask-ai
b
I want to stream some audio from redis, instead of processing from tts and output tts stream
t
Thanks for reaching out, Gaurab. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Could you please share a bit more about how you're planning to stream audio from Redis? For instance, are you aiming to stream pre-recorded audio files stored there, use Redis as a message queue for live audio streams, or maybe something different? Understanding this will really help me guide you toward the best approach using LiveKit’s features. I'm here to help! Sources: pkg/service/redisstore.go | examples/play_audio_stream.py | packages/livekit-rtc/src/audio_stream.ts | livekit-ffi/src/server/audio_stream.rs | Stream music over WebRTC using React and WebAudio
b
yes pre-recorded audio files stored in redis
t
LiveKit doesn’t directly support streaming pre-recorded audio files from Redis, but don’t worry—we can definitely work around this together! Here’s a friendly way to approach it: • First, retrieve the audio file from Redis in your application (for example, as a byte stream). • Then, save the audio data temporarily to disk or make it available as a readable stream. • Finally, use a LiveKit SDK, like the Python SDK, to stream the file into a LiveKit room by using tools such as
MediaFileStreamer
. This method lets you broadcast your audio smoothly into a LiveKit room. If you’d like, I’d be more than happy to share a detailed code example to help you get started—just let me know! Sources: README.md | examples/video-stream/video_play.py | pkg/provider/embeds.go