pip install lokutor for API use; pip install "lokutor[audio]" (needs PortAudio: brew install portaudio or sudo apt install portaudio19-dev) to play or record on the local machine. Every voice and language argument also accepts a plain string ("F1", "es").
VoiceAgentClient
Constructor
Events
Register listeners with
.on(event, callback):
Methods
TTSClient
Constructor
Methods
synthesize parameters
STTClient
Standalone client for one-shot transcription of a complete, pre-recorded audio clip. See Speech-to-Text for the full guide.
Constructor
Methods
transcribe parameters
Returns a
dict with keys text, latency_ms, engine, sample_rate, language, duration_seconds, and optionally segments.
SpeechToTextClient
Standalone client for continuous/live transcription from a microphone, with server-side VAD detecting utterance boundaries. See Speech-to-Text for the full guide.
Constructor
Methods
Enums
VoiceStyle
F1–F5 (female), M1–M5 (male): the voice slots GET /voices returns. Each resolves to the native speaker of the session’s language (Voices). The enum also has explicit EN_* and ESCA_* members, which pin one reference speaker.
Language
ENGLISH, SPANISH, CATALAN, GALICIAN, BASQUE, PORTUGUESE, FRENCH, ITALIAN, GERMAN
Data structures
Viseme
Audio utilities
lokutor.audio_utils provides:
pcm16_to_float32/float32_to_pcm16resample/resample_with_anti_aliasingcalculate_rmsStreamResampler— for streaming scenarios