How do i make my Azure Text to speech voice use a specific style in python

Legate Lanius 0 Reputation points
2023-09-08T02:18:16.8733333+00:00

speech_config.speech_synthesis_voice_name = "en-US-DavisNeural"

text = "Hi, this is Davis"

# use the default speaker as audio output.

result = speech_synthesizer.speak_text_async(text).get()

Theres my code so far. how can i make the voice use a different style? using SSML wont work to my knowledge because what the voice will be saying is changing constantly and being said in real time.

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
2,070 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-09-08T21:13:09.44+00:00

    Hello @Legate Lanius , Thanks for using Microsoft Q&A Platform.

    Generally, to change the voice style in Azure Text to Speech, you can set the speech_synthesis_voice_name to the name of the voice you want to use as you have already set the speech_synthesis_voice_name property to "en-US-DavisNeural". The list of available voices can be found in the documentation: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts

    To know more information on how the voice that speaks is determined in order of priority is explained here: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/how-to-speech-synthesis?tabs=browserjs%2Cterminal&pivots=programming-language-python#select-synthesis-language-and-voice

    Is this something you are looking for?

    Regards,
    Vasavi

    -Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.