Інтеграція Azure Speech Services для синтезу мовлення (Neural TTS) Azure Neural TTS — велика бібліотека голосів (400+) з підтримкою SSML, кастомних голосів через Custom Neural Voice та мультистильових голосів. Для російської доступні голоси ru-RU: Svetlana, Dariya, Dmitry та інші. ### Синтез через Python SDK```python
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 = """
### Стилі мови (для голосів, що підтримуються) Деякі Azure-голоси підтримують стилі: `cheerful`, `sad`, `angry`, `fearful`, `disgruntled`, `serious`, `depressed`, `embarrassed`, `gentle`, `customerservice`. ### Потоковий синтез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)







