ElevenLabsTTSClient

org.llm4s.speech.tts.provider.ElevenLabsTTSClient
See theElevenLabsTTSClient companion object
final class ElevenLabsTTSClient(config: TTSConfig, httpClient: Llm4sHttpClient) extends TextToSpeech

ElevenLabs text-to-speech (POST /v1/text-to-speech/{voice_id}).

Requests output_format=pcm_24000 (raw 24 kHz, 16-bit, mono little-endian samples), so GeneratedAudio.data is headerless PCM described by an honest AudioMeta. Write it out with org.llm4s.speech.io.WavFileGenerator.saveAsWav. With options.outputFormat = AudioFormat.Mp3 it requests mp3_44100_128 and returns the MP3 bytes untouched. options.voice overrides the configured voice id.

Value parameters

config

configuration from org.llm4s.speech.config.SpeechConfigLoader.tts; model is the ElevenLabs model_id and voice the voice id

httpClient

HTTP transport, replaceable in tests

Attributes

Companion
object
Source
ElevenLabsTTSClient.scala
Graph
Supertypes
trait TextToSpeech
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def synthesize(text: String, options: TTSOptions): Result[GeneratedAudio]

Attributes

Definition Classes
Source
ElevenLabsTTSClient.scala

Concrete fields

override val name: String

Attributes

Source
ElevenLabsTTSClient.scala