SonioxTTSModel (providers/soniox_tts.py)

Patter · libraries/python/getpatter/providers/soniox_tts.py · python · MIT
voice, Voice / Speech

Async TTS provider for Soniox using aiohttp, exposing a clean TTS interface for Python apps.

# Source: https://github.com/PatterAI/Patter | License: MIT | Copyright 2026 Patter Contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""Soniox TTS provider — HTTP one-shot bytes endpoint, pure aiohttp.

Targets the REST ``POST https://tts-rt.soniox.com/tts`` endpoint which returns
raw audio bytes (Content-Type matches the requested ``audio_format``). This
maps cleanly onto Patter's ``TTSProvider.synthesize(text) -> AsyncIterator[bytes]``
contract and requires no vendor SDK — only ``aiohttp``.

Soniox also exposes a richer WebSocket streaming mode
(``wss://tts-rt.soniox.com/tts-websocket``) that starts emitting audio from
the first few words for lower TTFB; that mode is not used here because the REST
endpoint already maps onto Patter's streaming contract while ke

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key