Integración domótica Azure Speech, gratuita y de código abierto

Microsoft Azure Speech neural voices for Gladys announcements, with your own key.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
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
- In the Azure portal, Create a resource → Speech (or "Speech service").
- Choose a region (for example West Europe) and the Free F0 pricing tier, or Standard S0.
- Once created, open Keys and Endpoint: copy KEY 1 (or KEY 2) and note the Location/Region
(
westeurope,francecentral…).
Configuration
| Field | What it does |
|---|---|
| Resource key | Kept by Gladys in its database, never shown again, sent only to Azure Speech (in the Ocp-Apim-Subscription-Key header). |
| Region of the resource | The region shown next to the key (default westeurope). A key works only in its own region. |
| French / English / German voice | The voice for each language (standard neural voices; "multilingual" ones also read other languages). |
| Language when unknown | The voice used when Gladys sends no language or another one. |
| Speaking rate | Very 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
/datais read), until you enter another key, choose another region, or the Test button succeeds (it sends anyway)./datakeeps 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/dataacross 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.
Parámetros de configuración
Estos son los parámetros que Azure Speech te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Your Azure Speech resource | section | No | Azure 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 key | secret | Sí | KEY 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 resource | select | No | The “Location/Region” shown on the Keys and Endpoint page: a key works only in its own region. |
| French voice | select | No | Standard neural voices (HD voices cost more and are not offered). A voice the region does not offer is refused by Azure, not billed. |
| English voice | select | No | Standard neural voices (HD voices cost more and are not offered). A voice the region does not offer is refused by Azure, not billed. |
| German voice | select | No | Standard 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 unknown | select | No | The voice used when Gladys sends no language, or another one. |
| Speaking rate | select | No | |
| Monthly limit (characters) | number | No | Nothing 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). |
Cómo instalar Azure Speech en Gladys
- En Gladys, abre Integraciones: Azure Speech aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/lm1lc3n7/gladys-azure-speech:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-azure-speech.
Azure Speech requiere Gladys >=5.3.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.
¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.
Sobre las integraciones externas
Azure Speech es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.
- Explorar todas las integraciones, nativas y de la comunidad
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación