Overview

Neuphonic provides high-quality text-to-speech synthesis with two implementations:
  • NeuphonicTTSService: WebSocket-based with real-time streaming and interruption support
  • NeuphonicHttpTTSService: HTTP-based with server-sent events.
NeuphonicTTSService is the recommended option for interactive applications requiring low latency.

Installation

To use Neuphonic services, install the required dependencies:
pip install "pipecat-ai[neuphonic]"
You’ll also need to set up your Neuphonic API key as an environment variable: NEUPHONIC_API_KEY.
Get your API key from the Neuphonic Console.

Frames

Input

  • TextFrame - Text content to synthesize into speech
  • TTSSpeakFrame - Text that should be spoken immediately
  • TTSUpdateSettingsFrame - Runtime configuration updates (voice, speed, etc.)
  • LLMFullResponseStartFrame / LLMFullResponseEndFrame - LLM response boundaries

Output

  • TTSStartedFrame - Signals start of synthesis
  • TTSAudioRawFrame - Generated audio data chunks (streaming)
  • TTSStoppedFrame - Signals completion of synthesis
  • ErrorFrame - API or processing errors

Service Comparison

FeatureNeuphonicTTSService (WebSocket)NeuphonicHttpTTSService (HTTP)
Streaming✅ Real-time chunks✅ Server-sent events
Interruption✅ Advanced handling❌ Limited support
Latency🚀 Ultra-low📈 Moderate

Language Support

Neuphonic supports multiple languages with automatic base language detection:
Language CodeDescriptionService Code
Language.ENEnglishen
Language.ESSpanishes
Language.DEGermande
Language.NLDutchnl
Language.ARArabicar
Language.FRFrenchfr
Language.PTPortuguesept
Language.RURussianru
Language.HIHindihi
Language.ZHChinesezh
Regional variants (e.g., EN_US, ES_ES) are automatically mapped to their base language.

Usage Example

Initialize the NeuphonicTTSService and use it in a pipeline:
from pipecat.services.neuphonic.tts import NeuphonicTTSService
from pipecat.transcriptions.language import Language
import os

# Configure WebSocket service
tts = NeuphonicTTSService(
    api_key=os.getenv("NEUPHONIC_API_KEY"),
    voice_id="fc854436-2dac-4d21-aa69-ae17b54e98eb",  # Emily voice
    params=NeuphonicTTSService.InputParams(
        language=Language.EN,
        speed=1.2
    ),
    sample_rate=22050
)

# Use in pipeline
pipeline = Pipeline([
    transport.input(),
    stt,
    context_aggregator.user(),
    llm,
    tts,
    transport.output(),
    context_aggregator.assistant()
])

HTTP Service

Initialize the NeuphonicHttpTTSService and use it in a pipeline:
from pipecat.services.neuphonic.tts import NeuphonicHttpTTSService

# For simpler, HTTP-based synthesis
http_tts = NeuphonicHttpTTSService(
    api_key=os.getenv("NEUPHONIC_API_KEY"),
    voice_id="your-voice-id",
    params=NeuphonicHttpTTSService.InputParams(
        language=Language.ES,
        speed=1.0
    )
)

Dynamic Voice Switching

from pipecat.frames.frames import TTSUpdateSettingsFrame

# Change voice during conversation
await task.queue_frame(TTSUpdateSettingsFrame({
    "voice_id": "new-voice-id"
}))

Metrics

Both services provide comprehensive metrics:
  • Time to First Byte (TTFB) - Latency from text input to first audio
  • Processing Duration - Total synthesis time
  • Character Usage - Text processed for billing
Learn how to enable Metrics in your Pipeline.

Additional Notes

  • WebSocket Recommended: Use NeuphonicTTSService for real-time applications requiring low latency and interruption support