IStreamingTts<T>
Interfaces · AiDotNet.TextToSpeech.Interfaces
Interface for TTS models that support streaming/chunked synthesis with low latency.
Implements: ITtsModel<T>
How It Works
Streaming TTS models can begin outputting audio before the full utterance is processed, enabling low-latency applications like conversational AI:
- CosyVoice 2: 150ms first-packet latency with streaming flow matching
- Chatterbox: real-time streaming with emotion control
- XTTS-v2: chunked streaming for voice cloning
Properties
| Property | Summary |
|---|---|
bool HasMoreChunks { get; } |
Gets whether there are more audio chunks available. |
int FirstPacketLatencyMs { get; } |
Gets the target first-packet latency in milliseconds. |
Methods
| Method | Summary |
|---|---|
Tensor<T> SynthesizeFirstChunk(string text, int chunkSize) |
Synthesizes audio in streaming chunks, returning the first available audio chunk. |
Tensor<T> SynthesizeNextChunk() |
Gets the next audio chunk from an ongoing streaming synthesis. |