Azure Speech Services integration for speech synthesis (Neural TTS). Azure Neural TTS is a comprehensive library of voices (400+) with support for SSML, custom voices via Custom Neural Voice, and multi-style voices. For Russian, ru-RU voices are available: Svetlana, Dariya, Dmitry, and others. ### Synthesis via the Python SDK
import azure.cognitiveservices.speech as speechsdk
speech_config = speechsdk.SpeechConfig(
subscription=os.environ["AZURE_SPEECH_KEY"],
region="westeurope"
)
speech_config.speech_synthesis_voice_name = "ru-RU-SvetlanaNeural"
# Вывод в файл
audio_config = speechsdk.audio.AudioOutputConfig(filename="output.wav")
synthesizer = speechsdk.SpeechSynthesizer(
speech_config=speech_config,
audio_config=audio_config
)
# Синтез с SSML
ssml = """
<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis'
xmlns:mstts='https://www.w3.org/2001/mstts' xml:lang='ru-RU'>
<voice name='ru-RU-DmitryNeural'>
<mstts:express-as style='customerservice'>
Добрый день! Рады помочь вам сегодня.
</mstts:express-as>
</voice>
</speak>
"""
result = synthesizer.speak_ssml_async(ssml).get()
```### Speech styles (for supported voices) Some Azure voices support the following styles: `cheerful`, `sad`, `angry`, `fearful`, `disgruntled`, `serious`, `depressed`, `embarrassed`, `gentle`, `customerservice`. ### Streaming synthesis```python
# Streaming для Real-Time приложений
pull_stream = speechsdk.audio.PullAudioOutputStream()
audio_config = speechsdk.audio.AudioOutputConfig(stream=pull_stream)
synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config,
audio_config=audio_config)
```Price: Neural TTS $16/1M characters. Custom Neural Voice: $24/1M characters. Free: 500,000 characters/month. Delivery time: 1–2 days.







