Text-to-speech service implementation using Neuphonic’s API
NeuphonicTTSService
: WebSocket-based with real-time streaming and interruption supportNeuphonicHttpTTSService
: HTTP-based with server-sent events.NeuphonicTTSService
is the recommended option for interactive applications
requiring low latency.NEUPHONIC_API_KEY
.
TextFrame
- Text content to synthesize into speechTTSSpeakFrame
- Text that should be spoken immediatelyTTSUpdateSettingsFrame
- Runtime configuration updates (voice, speed, etc.)LLMFullResponseStartFrame
/ LLMFullResponseEndFrame
- LLM response boundariesTTSStartedFrame
- Signals start of synthesisTTSAudioRawFrame
- Generated audio data chunks (streaming)TTSStoppedFrame
- Signals completion of synthesisErrorFrame
- API or processing errorsFeature | NeuphonicTTSService (WebSocket) | NeuphonicHttpTTSService (HTTP) |
---|---|---|
Streaming | ✅ Real-time chunks | ✅ Server-sent events |
Interruption | ✅ Advanced handling | ❌ Limited support |
Latency | 🚀 Ultra-low | 📈 Moderate |
Language Code | Description | Service Code |
---|---|---|
Language.EN | English | en |
Language.ES | Spanish | es |
Language.DE | German | de |
Language.NL | Dutch | nl |
Language.AR | Arabic | ar |
Language.FR | French | fr |
Language.PT | Portuguese | pt |
Language.RU | Russian | ru |
Language.HI | Hindi | hi |
Language.ZH | Chinese | zh |
EN_US
, ES_ES
) are automatically mapped to their
base language.NeuphonicTTSService
and use it in a pipeline:
NeuphonicHttpTTSService
and use it in a pipeline:
NeuphonicTTSService
for real-time applications requiring low latency and interruption support