Azure Speech TTS Provider for OpenClaw Replies
This page covers Azure AI Speech text-to-speech integration for OpenClaw, including SSML-based REST API communication and output formats like MP3, Ogg/Opus, and mulaw. It is intended for developers configuring voice replies.
Read this when
- You want Azure Speech synthesis for outbound replies
- You need native Ogg Opus voice-note output from Azure Speech
Azure Speech is a text-to-speech provider bundled with Azure AI Speech. OpenClaw communicates directly with the Azure Speech REST API using SSML, producing MP3 for standard replies, native Ogg/Opus for voice notes, and 8 kHz mulaw for telephony channels like Voice Call. The request includes the provider-owned output format in the X-Microsoft-OutputFormat header.
| Detail | Value |
|---|---|
| Provider ID | azure-speech (alias: azure) |
| Website | Azure AI Speech |
| Docs | Speech REST text-to-speech |
| Auth | AZURE_SPEECH_KEY plus AZURE_SPEECH_REGION |
| Default voice | en-US-JennyNeural |
| Default file output | audio-24khz-48kbitrate-mono-mp3 |
| Default voice-note file | ogg-24khz-16bit-mono-opus |
Getting started
Create an Azure Speech resource
From the Azure portal, provision a Speech resource. Copy KEY 1 found under Resource Management > Keys and Endpoint, and note the resource location, for instance eastus.
AZURE_SPEECH_KEY=<speech-resource-key>
AZURE_SPEECH_REGION=eastus
Select Azure Speech in tts
{
tts: {
auto: "always",
provider: "azure-speech",
providers: {
"azure-speech": {
voice: "en-US-JennyNeural",
lang: "en-US",
},
},
},
}
Send a message
Transmit a reply over any connected channel. OpenClaw generates audio through Azure Speech, returning MP3 for standard audio or Ogg/Opus when the channel anticipates a voice note.
Configuration options
All configuration options are located under tts.providers["azure-speech"].
| Option | Description |
|---|---|
apiKey | Key for the Azure Speech resource. Defaults to AZURE_SPEECH_KEY, AZURE_SPEECH_API_KEY, or SPEECH_KEY. |
region | Region for the Azure Speech resource. Defaults to AZURE_SPEECH_REGION or SPEECH_REGION. |
endpoint | Optional override for the Azure Speech endpoint. Falls back to trusted AZURE_SPEECH_ENDPOINT. |
baseUrl | Optional override for the Azure Speech base URL. |
voice | Azure voice ShortName (default en-US-JennyNeural). Legacy alias: voiceId. |
lang | Language code for SSML (default en-US). |
outputFormat | Format for audio file output (default audio-24khz-48kbitrate-mono-mp3). |
voiceNoteOutputFormat | Format for voice-note output (default ogg-24khz-16bit-mono-opus). |
timeoutMs | Timeout override for requests in milliseconds. Falls back to the global tts.timeoutMs. |
The provider is considered configured when apiKey is set along with one of region, endpoint, or baseUrl. Environment variables serve only as fallbacks for config keys that remain unspecified. Workspace .env files cannot define AZURE_SPEECH_ENDPOINT; use the process environment, global runtime dotenv, or explicit configuration for endpoint routing.
Notes
Authentication
Azure Speech requires a Speech resource key, not an Azure OpenAI key. This key is transmitted as Ocp-Apim-Subscription-Key; OpenClaw derives https://<region>.tts.speech.microsoft.com from region unless endpoint or baseUrl is supplied.
Voice names
Use the Azure Speech voice ShortName value, for example en-US-JennyNeural. The bundled provider can enumerate voices through the same Speech resource, excluding those marked as deprecated, retired, or disabled.
Audio outputs
Azure supports output formats like audio-24khz-48kbitrate-mono-mp3,
ogg-24khz-16bit-mono-opus, and riff-24khz-16bit-mono-pcm. For voice-note targets, OpenClaw
requests Ogg/Opus so channels can send voice bubbles natively without a separate MP3 conversion, and it enforces
raw-8khz-8bit-mono-mulaw when telephony targets are used.
Alias
Existing configurations can use azure as a provider alias, though azure-speech should be used in new configurations to prevent confusion with Azure OpenAI model providers.
Related
-
Text-to-speech, A TTS overview, provider details, and
ttsconfiguration. -
Configuration, A full configuration reference that covers
ttssettings. -
Providers, Every bundled OpenClaw provider.
-
Troubleshooting, Frequent issues and steps for debugging.