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;
modelis the ElevenLabsmodel_idandvoicethe voice id - httpClient
-
HTTP transport, replaceable in tests
Attributes
- Companion
- object
- Source
- ElevenLabsTTSClient.scala
- Graph
-
- Supertypes
Members list
In this article
