Summary
Add TTS WebSocket streaming support to the Rust SDK, enabling real-time text-to-speech audio generation. This would allow Rust developers to stream text to Deepgram and receive audio chunks in real-time, essential for voice agent and interactive applications.
Problem it solves
Rust developers building low-latency voice applications (game engines, embedded systems, real-time communication servers) need streaming TTS for interactive speech synthesis. The Rust SDK currently has an open issue (#95) for TTS WebSocket support but no implementation. TTS REST is available but doesn't support streaming, which is required for real-time voice agent use cases where audio needs to start playing before the full response is generated.
Proposed API
use deepgram::tts::{TtsWebSocket, TtsOptions, TtsEvent};
let options = TtsOptions::builder()
.model("aura-2-en")
.encoding(AudioEncoding::Linear16)
.sample_rate(16000)
.build();
let mut tts_ws = deepgram.tts().websocket(options).await?;
// Send text for synthesis
tts_ws.send_text("Hello, how can I help you today?").await?;
tts_ws.flush().await?;
// Receive audio chunks
while let Some(event) = tts_ws.next().await {
match event? {
TtsEvent::Audio(data) => { /* play or forward audio bytes */ },
TtsEvent::Flushed => { /* all audio for current text received */ },
TtsEvent::Warning(msg) => { /* handle warning */ },
}
}
Acceptance criteria
Raised by the DX intelligence system.
Summary
Add TTS WebSocket streaming support to the Rust SDK, enabling real-time text-to-speech audio generation. This would allow Rust developers to stream text to Deepgram and receive audio chunks in real-time, essential for voice agent and interactive applications.
Problem it solves
Rust developers building low-latency voice applications (game engines, embedded systems, real-time communication servers) need streaming TTS for interactive speech synthesis. The Rust SDK currently has an open issue (#95) for TTS WebSocket support but no implementation. TTS REST is available but doesn't support streaming, which is required for real-time voice agent use cases where audio needs to start playing before the full response is generated.
Proposed API
Acceptance criteria
examples/directoryRaised by the DX intelligence system.