Skip to main content

Usage guide

Setup, environment variables, and Python/JavaScript/Go usage examples.

NeuphonicTTS

Streaming text-to-speech with Neuphonic, using your own Neuphonic API key. Good for low-latency, natural-sounding voices. Authenticates with NEUPHONIC_API_KEY from your environment, or an explicit api_key.

Fields

str
default:"UNSET"
Language code of the speech, e.g. “en” or “es”. Defaults to ‘en’.
Optional[str]
default:"UNSET"
Neuphonic voice ID to speak with. Leave unset to use Neuphonic’s standard voice for the language. Defaults to None (not set).
float
default:"UNSET"
Speaking rate, 0.7 to 2.0. Defaults to 0.8.
int
default:"UNSET"
Output sample rate in Hz: 8000, 16000 or 22050. Defaults to 22050.
Literal['pcm_linear', 'pcm_mulaw']
default:"UNSET"
Audio encoding of the generated speech: “pcm_linear” (16-bit linear) or “pcm_mulaw”. Defaults to ‘pcm_linear’.
str
default:"UNSET"
WebSocket URL of the Neuphonic API. Change it to use a different region. Defaults to ‘wss://eu-west-1.api.neuphonic.com’.
float
default:"UNSET"
Seconds after which the streaming connection is reopened, to stay within Neuphonic session limits. Defaults to 300.0.