Azure-Samples / cognitive-services-speech-sdk

Sample code for the Microsoft Cognitive Services Speech SDK
MIT License
2.89k stars 1.85k forks source link

How to Adjust "Speaking Style" for Neural Voices #2392

Closed jillbourque closed 5 months ago

jillbourque commented 5 months ago

Is there a way to adjust the "Speaking Styles" in SSML for the Neural Voices like Andrew, similar to how it can be done for voices like Jason?

Screenshot 2024-05-27 at 9 03 44 PM
telzhou618 commented 5 months ago
# Define the SSML with the voice style parameters
ssml_string = """
<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xml:lang='zh-CN'>
  <voice name='zh-CN-XiaoxiaoNeural'>
    <mstts:express-as style='poetry-reading'>
      登鹳雀楼
      王之涣〔唐代〕
      白日依山尽,黄河入海流。
      欲穷千里目,更上一层楼。
    </mstts:express-as>
  </voice>
</speak>
"""
ForrestGumb commented 5 months ago

Andrew voice doesn't support style. You can find a list of voice that support style here. https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts#voice-styles-and-roles

jillbourque commented 5 months ago

Okay, thank you!