diff --git a/docs.json b/docs.json index 0e57151..dd84f62 100644 --- a/docs.json +++ b/docs.json @@ -181,6 +181,7 @@ "server/services/tts/openai", "server/services/tts/piper", "server/services/tts/playht", + "server/services/tts/respeecher", "server/services/tts/rime", "server/services/tts/sarvam", "server/services/tts/xtts" diff --git a/server/services/supported-services.mdx b/server/services/supported-services.mdx index 32b1c23..be591ce 100644 --- a/server/services/supported-services.mdx +++ b/server/services/supported-services.mdx @@ -99,6 +99,7 @@ Text-to-Speech services receive text input and output audio streams or chunks. | [OpenAI](/server/services/tts/openai) | `pip install "pipecat-ai[openai]"` | | [Piper](/server/services/tts/piper) | No dependencies required | | [PlayHT](/server/services/tts/playht) | `pip install "pipecat-ai[playht]"` | +| [Respeecher](/server/services/tts/respeecher) | `pip install "pipecat-ai[respeecher]"` | | [Rime](/server/services/tts/rime) | `pip install "pipecat-ai[rime]"` | | [Sarvam](/server/services/tts/sarvam) | No dependencies required | | [XTTS](/server/services/tts/xtts) | `pip install "pipecat-ai[xtts]"` | diff --git a/server/services/tts/respeecher.mdx b/server/services/tts/respeecher.mdx new file mode 100644 index 0000000..4c36def --- /dev/null +++ b/server/services/tts/respeecher.mdx @@ -0,0 +1,132 @@ +--- +title: "Respeecher" +description: "Text-to-speech service using the Respeecher Space WebSocket API" +--- + +## Overview + +The Respeecher Space API provides high-quality streaming text-to-speech synthesis with low latency. + + + + Complete API documentation and method details + + + Official Respeecher Space documentation + + + Working example with interruption handling + + + +## Installation + +To use Respeecher services, install the required dependencies: + +```bash +pip install "pipecat-ai[respeecher]" +``` + +You'll also need to set up your Respeecher API key as an environment variable: `RESPEECHER_API_KEY`. + + + Get your API key by signing up at + [Respeecher Space](https://space.respeecher.com/). + + +## Frames + +### Input + +- `TextFrame` - Text to synthesize into speech, subject to optional aggregation +- `TTSSpeakFrame` - Text that should be spoken immediately +- `TTSUpdateSettingsFrame` - Runtime configuration updates (e.g., voice, sampling params) +- `LLMFullResponseStartFrame` / `LLMFullResponseEndFrame` - LLM response boundaries + +### Output + +- `TTSStartedFrame` - Signals start of synthesis +- `TTSAudioRawFrame` - Generated audio data chunks +- `TTSStoppedFrame` - Signals completion of synthesis +- `ErrorFrame` - Connection or processing errors + +## Language Support + +Refer to the Respeecher Space [Docs](https://space.respeecher.com/docs) +for language support in different models. + +## Supported Sample Rates + +All common sample rates are supported. + +## Usage Example + +Initialize the WebSocket service with your API key and desired voice: + +```python +from pipecat.services.respeecher.tts import RespeecherTTSService +import os + +# Configure WebSocket service +tts = RespeecherTTSService( + api_key=os.getenv("RESPEECHER_API_KEY"), + voice_id="samantha", + params=RespeecherTTSService.InputParams( + sampling_params={ + # Optional sampling params overrides + # See https://space.respeecher.com/docs/api/tts/sampling-params-guide + # "temperature": 0.5 + }, + ), +) + +# Use in pipeline +pipeline = Pipeline([ + transport.input(), + stt, + llm, + tts, + transport.output() +]) +``` + +### Dynamic Configuration + +Make settings updates by pushing a `TTSUpdateSettingsFrame` for the `RespeecherTTSService`: + +```python +from pipecat.frames.frames import TTSUpdateSettingsFrame + +await task.queue_frame( + TTSUpdateSettingsFrame(settings={"voice": "your-new-voice-id", "sampling_params": {"temperature": 0.5}}) +) +``` + +## Metrics + +This service provides: + +- **Time to First Byte (TTFB)** - Latency from text input to first audio +- **Processing Duration** - Total synthesis time +- **Usage Metrics** - Character count and synthesis statistics + + + [Learn how to enable Metrics](/guides/fundamentals/metrics) in your Pipeline. + + +## Additional Notes + +- **Connection Management**: WebSocket lifecycle is handled automatically with reconnection support +- **Sample Rate**: Set globally in `PipelineParams` rather than per-service for consistency