Soniox plugin for LiveKit Agents
Support for Soniox Speech-to-Text and Text-to-Speech APIs, using WebSocket streaming interfaces.
See STT documentation and TTS documentation for more information.
Installation
pip install livekit-plugins-soniox
Pre-requisites
The Soniox plugin requires an API key to authenticate. You can get your Soniox API key here.
Set API key in your .env file:
SONIOX_API_KEY=<your_soniox_api_key>
Usage
Speech-to-Text (STT)
Use Soniox STT in an AgentSession or as a standalone transcription service:
from livekit.plugins import soniox
session = AgentSession(
stt=soniox.STT(),
# ... llm, tts, etc.
)
Text-to-Speech (TTS)
Use Soniox TTS for real-time speech synthesis:
from livekit.plugins import soniox
session = AgentSession(
tts=soniox.TTS(
language="en",
voice="Maya",
speed=1.0, # 0.7-1.3
),
# ... stt, llm, etc.
)
The TTS supports real-time streaming from LLM - text chunks are tokenized and sent to Soniox as words are formed, enabling low-latency speech synthesis.
More information and reference
Explore integration details and find comprehensive examples: