<aztts> · Azure Speech · SSML · part of tts

aztts

aztts speaks text with Azure Speech. It is the tts core fixed to Azure, with the same daemon, queue, mute and remote protocol. It turns plain text into SSML, escaping it with the ssml library and wrapping it in the voice, style and prosody you ask for; --print-ssml shows the document it would send, without a credential or a network call.

aztts 'Hello'                                     # MAI-Voice-2.1-Flash, en-GB, to the speakers
aztts -f mp3 -o greeting.mp3 'Hello'
ssml --model MAI-Voice-2.1 --voice en-US-Iris 'Hi' | aztts --ssml
aztts --remote studio --pan 1 'From the right'

The document it sends

aztts --print-ssml --voice en-US-Iris:MAI-Voice-2.1 --style cheerful --degree 1.2 --speed .9 'Good morning.'
<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xml:lang='en-GB'><voice name='en-US-Iris:MAI-Voice-2.1'><lang xml:lang='en-GB'><mstts:express-as style='cheerful' styledegree='1.20'><prosody rate='-10.00%' pitch='+0.00%' volume='100.00'>Good morning.</prosody></mstts:express-as></lang></voice></speak>
The document aztts sends The SSML that aztts --print-ssml --voice en-US-Iris:MAI-Voice-2.1 --style cheerful --degree 1.2 --speed .9 'Good morning.' prints, drawn as nested elements: speak with xml:lang en-GB; voice named en-US-Iris:MAI-Voice-2.1; lang en-GB; mstts:express-as with style cheerful and styledegree 1.20; and prosody with rate −10%, pitch +0% and volume 100, around the escaped text. <speak xml:lang"en-GB" > <voice name"en-US-Iris:MAI-Voice-2.1" > <lang xml:lang"en-GB" > <mstts:express-as style"cheerful" styledegree"1.20" > <prosody rate"-10.00%" pitch"+0.00%" volume"100.00" > Good morning.
Every flag has a place. --voice names the voice, --style and --degree become an express-as, --speed .9 a rate of −10%; the text is escaped, never interpreted.

Authentication

Resources with keys use AZURE_SPEECH_API_KEY, read only at generation and never accepted as an argument or a config field. Resources with local authentication switched off use Microsoft Entra: a broker command fetches a token, and from then on it is handled with care.

Keyless Azure, with Entra How aztts authenticates to an Azure Speech resource that has keys disabled. With auth set to entra, it runs the configured broker (az or az-token) by argv, never through a shell, asking for a token for Cognitive Services. The token is kept in memory only, shared by concurrent requests, reused until shortly before it expires, and in the daemon pre-warmed every 30 seconds. It is sent as Authorization: Bearer to the resource's custom domain, and never together with a key. Regional tts.speech.microsoft.com hosts reject a plain bearer, so they need the resource ID, sent as Bearer aad#RESOURCE_ID#TOKEN, and are refused before any broker call without it. A 401 drops only the rejected token, and the failed request is not replayed. aztts / tts daemonauth: entra token brokeraz or az-token, by argv≤ 45 s · ≤ 128 KiB token, in memoryshared · refreshed earlydaemon pre-warms 30 s custom domainBearer TOKEN regional hostBearer aad#ID#TOKENneeds resource-id refused before any callno resource-id
Tokens never touch disk or logs. One acquisition is shared by concurrent requests; a 401 drops only that token, and the request is not replayed.
Where the request goes How aztts turns the endpoint you give it into the URL it calls. A regional origin such as https://eastus.tts.speech.microsoft.com gains /cognitiveservices/v1. A resource's custom domain on cognitiveservices.azure.com or services.ai.azure.com, or such a domain with a bare /tts, gains /tts/cognitiveservices/v1. Any other explicit path is used as given. Redirects are never followed. https://eastus.tts.speech.microsoft.com https://NAME.cognitiveservices.azure.com https://host/explicit/path + /cognitiveservices/v1 + /tts/cognitiveservices/v1 used as given
Give it the address you have. Origins and bare custom domains are completed; explicit paths are respected.

Output

Audio is 16-bit 24 kHz mono PCM by default, or WAV, or 48 kbps MP3. Raw and file output never play; files are replaced atomically, through managed symlinks, and a failure leaves the old file untouched. There is no cache and no automatic billed retry. Arguments form one utterance; otherwise each non-empty line of stdin is one. Everything else, from the daemon and its FIFO playback to cancellation, panning and mute, is the tts core's.