SonusLabSonusLab

Text to Speech

Generate speech from text. The SDK abstracts provider differences behind a single interface.

ElevenLabs

High-quality multilingual voices with fine-grained control over stability and similarity.

Models

eleven_multilingual_v2eleven_flash_v2_5eleven_turbo_v2_5

Fish Audio

Best for custom voice clones. Pass a voice clone ID as the voiceId.

Character limits

FreePro, Premium200 characters per generation500 characters per generation
sonus.tts.generate({ text, voiceId, provider, ... })

Generate speech from text. Returns a sound object with a direct download link.

ParameterTypeDescription
textrequiredstringText to convert to speech
voiceIdrequiredstringVoice ID to use
providerrequired"elevenlabs" | "fish"TTS provider
namestringName for the generated sound
modelIdstringElevenLabs model (default: eleven_multilingual_v2)
stabilitynumberVoice stability 0–1 (ElevenLabs only)
similarityBoostnumberSimilarity boost 0–1 (ElevenLabs only)
ElevenLabs
const { sound, error } = await sonus.tts.generate({
  text: 'Welcome to SonusLab!',
  voiceId: 'voice_id_here',
  provider: 'elevenlabs',
  stability: 0.5,
  similarityBoost: 0.75,
})
Fish Audio (with voice clone)
const { sound, error } = await sonus.tts.generate({
  text: 'Hello in my cloned voice!',
  voiceId: 'your_clone_id',
  provider: 'fish',
})
sonus.tts.listVoices()

List available built-in voices.

const { voices, error } = await sonus.tts.listVoices()