Skip to navigation

Azure

Text-to-speech

View as MarkdownOpen in Claude

Microsoft’s Azure platform offers an impressive array of high-quality, multilingual voices in its Neural model.

Voices

Press play to audition any Azure voice, then copy config to grab the value for SWML or your SDK.

Usage

Azure voice IDs conform to the following format:

azure.<voice>

Where <voice> is the full Azure voice code (e.g., en-US-AvaNeural).

Examples:

azure.en-US-AvaNeural
azure.en-GB-SoniaNeural
azure.de-DE-KatjaNeural
azure.es-ES-ElviraNeural

Note: Azure voice IDs already include language information, so no additional language parameter is needed.

Languages

Azure Neural voices are interchangeably compatible with all supported languages. Rather than setting language with the language code, simply provide input text in the desired language.

Consult the Azure supported languages resource for an up-to-date list of supported languages.

SSML support

Azure voices support Speech Synthesis Markup Language (SSML) for advanced control over:

  • Prosody (pitch, rate, volume)
  • Emphasis and breaks
  • Phonetic pronunciation
  • Multi-language content

Consult Azure’s SSML documentation for detailed usage instructions.


Examples

Learn how to use Azure voices on the SignalWire platform.

Use the languages SWML method to set one or more voices for an AI agent.

# Install: python -m pip install signalwire-sdk==3.4.1
# Save as azure_ai_agent.py and run: python azure_ai_agent.py
from signalwire import SWMLBuilder, SWMLService
service = SWMLService(
name="azure-ai-agent",
route="/swml",
port=3000,
basic_auth=("signalwire", "<YOUR_BASIC_AUTH_PASSWORD>"),
)
SWMLBuilder(service).ai(
prompt_text="Have an open-ended conversation about flowers.",
languages=[{
"name": "English",
"code": "en-US",
"voice": "azure.en-US-AvaNeural",
}],
)
service.serve()

Alternatively, use the say_voice parameter of the play SWML method to select a voice for basic TTS.

# Install: python -m pip install signalwire-sdk==3.4.1
# Save as azure_tts.py and run: python azure_tts.py
from signalwire import SWMLBuilder, SWMLService
service = SWMLService(
name="azure-tts",
route="/swml",
port=3000,
basic_auth=("signalwire", "<YOUR_BASIC_AUTH_PASSWORD>"),
)
builder = SWMLBuilder(service)
builder.set(say_voice="azure.en-US-AvaNeural")
builder.play(url="say:Greetings. This is the Ava voice from Microsoft Azure's Neural text-to-speech model.")
service.serve()

The Server SDKs build each document and serve it at /swml on port 3000. The server answers only requests that carry the username signalwire and the password you set in place of <YOUR_BASIC_AUTH_PASSWORD>. To send calls from your phone number to the server, follow Answer a call via SWML.