Skip to main content

Azure Speech smart home integration, free and open source

Azure Speech integration for Gladys Assistant

Microsoft Azure Speech neural voices for Gladys announcements, with your own key.

Gives Gladys the neural voices of Microsoft Azure Speech for its announcements (the "Play a notification" scene action) and the voice assistant reply, with the key of your own Speech resource. Unofficial: not affiliated with Microsoft.

This integration has never been tested with a real Azure account yet: it was built from the Azure Speech REST API documentation and tested against a local imitation of that API.

What it does​

Gladys sends a text (2,000 characters at most) and the language of the user. The integration picks the voice you chose for that language (French, English or German; the "Language when unknown" voice otherwise), asks Azure Speech for an MP3 clip (24 kHz, 48 kbit/s) and hands it to Gladys, which plays it on your speakers.

Then, in Gladys, open Integrations → Artificial Intelligence, card Voice, and select Azure Speech.

Limits of Gladys itself (not of this integration): the clip is served to speakers on your local network, and the voice assistant reply stays in text in an HTTPS page (see the Gladys documentation).

What it costs​

Azure Speech is billed per character sent, on your Azure subscription (prices on azure.microsoft.com, November 2026): the free tier (F0) of a Speech resource gives 500,000 characters of neural voices a month; on the paid tier (S0), standard neural voices cost about 15 USD per million characters. Only standard neural voices are offered here: the HD voices cost more.

To keep the bill under control:

  • Monthly limit (default 500,000 characters, the free tier): counted in memory before each request leaves, and written to /data (the write waited for 1 s at most); once reached, nothing more is sent until the next calendar month (UTC) or a higher limit. The integration counts what Azure bills: every character of the request, the speaking rate tag included (about 32 characters per announcement when the rate is not "Normal"), &, < and > as their XML entity (5 or 4 characters), and a Chinese character twice. The free tier follows the Azure month of the resource, so keep a margin. A request that may have been billed (no answer, connection cut, unusable clip) stays counted; a request Azure answered with an error status is not. An announcement is never blocked by /data (delayed 3 s at most): when it is not read yet (2 s at most), read-only or slow, the request leaves all the same and the status says "the monthly counter is not saved: the limit is only guaranteed until the next restart" (the pause and a refusal kept there may be unknown too). A cut of power or a crash at the wrong moment can lose the count of one request.
  • The same text in the same voice is played again from memory (24 hours, 20 clips), not billed twice; asked several times at once (a scene announcing on several speakers), it makes one request whose answer all share.
  • At most 2 requests at once and 8 waiting; more at the same moment are refused ("Too many announcements").
  • No retry: a failed request is not sent again by the integration (a retry could be billed twice).
  • The free tier also accepts only 20 requests per 60 seconds: beyond that Azure answers HTTP 429, and the integration pauses every announcement for 60 s (longer if it goes on, see below).
  • With the free tier, Azure stops by itself at its quota (the integration then shows the error Azure answers). With S0, nothing stops on the Azure side: set a budget alert in Azure Cost Management as well.

Create the Speech resource​

  1. In the Azure portal, Create a resource → Speech (or "Speech service").
  2. Choose a region (for example West Europe) and the Free F0 pricing tier, or Standard S0.
  3. Once created, open Keys and Endpoint: copy KEY 1 (or KEY 2) and note the Location/Region (westeurope, francecentral…).

Configuration​

FieldWhat it does
Resource keyKept by Gladys in its database, never shown again, sent only to Azure Speech (in the Ocp-Apim-Subscription-Key header).
Region of the resourceThe region shown next to the key (default westeurope). A key works only in its own region.
French / English / German voiceThe voice for each language (standard neural voices; "multilingual" ones also read other languages).
Language when unknownThe voice used when Gladys sends no language or another one.
Speaking rateVery slow to very fast (SSML prosody).
Monthly limit (characters)1,000 to 100,000,000; default 500,000.

The Test the voice button asks Azure for a short sentence (about 50 billed characters, about 80 with a speaking rate other than "Normal") with the saved settings and says how long it took. Nothing is played.

When something goes wrong​

The status of the Configuration screen says why:

  • Azure refused this key (HTTP 401: wrong or regenerated key, or a key of a resource in another region): nothing more is sent with it in that region, even after a restart (once /data is read), until you enter another key, choose another region, or the Test button succeeds (it sends anyway). /data keeps only 8 bits of a salted hash of the refused key and region, never the key: after a restart, another key has 1 chance in 256 to look refused; the Test button then clears it.
  • Azure denied the synthesis (HTTP 403): for example the quota of the free tier is used up, or the network rules of the resource block the address of Gladys. This is not a refusal of the key: the next announcement tries again.
  • Slow down / Azure failed (HTTP 429 or 5xx): no request for 60 s, then 2, 4… minutes up to 1 hour if it goes on (longer when Azure asks for it with Retry-After, 6 hours at most); the Test button waits too. The pause is kept in /data across a restart; a success ends it.
  • Azure refused the request (HTTP 400 or another 4xx): usually a voice the region does not offer; only the status code is shown (the body of the answer could quote your text); nothing is billed.
  • Could not be reached, or the connection was cut: a cut after the request left stays counted.
  • Did not answer in time: Gladys waits 30 s; the integration gives up at 25 s.

Privacy​

The text to speak is sent to Microsoft Azure, to the region of your resource. The integration never writes it to the logs or to /data (only its length); the clips stay in memory only. A redirect from the Azure address is never followed, so the key goes nowhere else.

Configuration settings​

These are the settings Azure Speech asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Your Azure Speech resourcesectionNoAzure Speech is billed to your own Azure subscription, per character spoken; the free tier (F0) gives 500,000 characters of neural voices a month. Create a Speech resource in the Azure portal, then copy one of its keys and its region (Keys and Endpoint page).
Resource keysecretYesKEY 1 or KEY 2 of the Speech resource. Kept by Gladys in its database, never shown again, sent only to Azure Speech.
Region of the resourceselectNoThe “Location/Region” shown on the Keys and Endpoint page: a key works only in its own region.
French voiceselectNoStandard neural voices (HD voices cost more and are not offered). A voice the region does not offer is refused by Azure, not billed.
English voiceselectNoStandard neural voices (HD voices cost more and are not offered). A voice the region does not offer is refused by Azure, not billed.
German voiceselectNoStandard neural voices (HD voices cost more and are not offered). A voice the region does not offer is refused by Azure, not billed.
Language when unknownselectNoThe voice used when Gladys sends no language, or another one.
Speaking rateselectNo
Monthly limit (characters)numberNoNothing more is sent to Azure once this many billable characters were sent in the calendar month (UTC), counted as Azure bills them: the speaking rate tag (about 32 characters per announcement when it is not Normal) and a Chinese character twice. The default, 500,000, is the free tier (F0); on the paid tier (S0), 1,000,000 characters of neural voices cost about 15 USD (see the price page).

How to install Azure Speech in Gladys​

  1. In Gladys, open Integrations: Azure Speech appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/lm1lc3n7/gladys-azure-speech:0.1.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/LM1LC3N7/gladys-azure-speech.

Azure Speech requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Azure Speech is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by LM1LC3N7, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂