# `Octoroom.Agent.Processors.TTS`
[🔗](https://github.com/samrat/octoroom/blob/v0.1.0/agents/lib/octoroom/agent/processors/tts.ex#L1)

Speaks `Text` frames.

For each chunk it pushes `TTSStarted` (first chunk of a response),
`TTSText`, `OutputAudio` as the audio streams in, and `TTSStopped` when the
response is done. Chunks that arrive while one is synthesizing are queued
and sent as one request, so the voice keeps its prosody across sentences.
`LLMResponseEnd` and `End` wait until the queued audio is out.

Options are `Octoroom.Agent.TTS`'s: `:provider` and `:model` (both needed),
`:voice`, `:api_key` and the provider's own, with
`:output_sample_rate` as the provider's `:sample_rate`. It connects the
provider once (`Octoroom.Agent.TTS.connect/2`), for those that keep a
connection. Also
`:chunk_timeout_ms`, and `:synthesize`, a
`fn text, on_audio -> :ok | {:error, reason} end` that replaces the
provider (for tests).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
