AzureTTSClient

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

Azure AI Speech text-to-speech (REST POST /cognitiveservices/v1, SSML body).

Requests the raw-24khz-16bit-mono-pcm output format, so GeneratedAudio.data is headerless 24 kHz, 16-bit, mono PCM described by an honest AudioMeta. Write it out with org.llm4s.speech.io.WavFileGenerator.saveAsWav.

With options.outputFormat = AudioFormat.Mp3 it requests audio-24khz-48kbitrate-mono-mp3 and returns the MP3 bytes untouched.

options.voice overrides the configured voice name; options.language sets xml:lang (default: the locale prefix of the voice name, else en-US); options.speakingRate becomes a prosody rate.

Value parameters

config

configuration from org.llm4s.speech.config.SpeechConfigLoader.tts; baseUrl is the regional https://<region>.tts.speech.microsoft.com endpoint

httpClient

HTTP transport, replaceable in tests

Attributes

Companion
object
Source
AzureTTSClient.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
AzureTTSClient.scala

Concrete fields

override val name: String

Attributes

Source
AzureTTSClient.scala