how to configure ssml

Nathalie Froissart 25 Reputation points
2023-02-16T15:03:01.37+00:00

Hello, is it possible to use the azure cognitive service, speech to get take in a text from the comand promt and configure the voice to emphesise the first word in the senctence or to have a Higher pitch after a "?" token? I want to make if and else statement to the input text that is supposed to be read out loud.

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
2,061 questions
{count} vote

Accepted answer
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-02-17T06:26:23.7833333+00:00

    Hi @Nathalie Froissart , Thanks for using Microsoft Q&A Platform.

    Yes, it is possible to use Azure Cognitive Services Speech to get text input from the command prompt and configure the voice to emphasize the first word in the sentence or to have a higher pitch after a "?" token. For information on how to input the text, see this speech synthesis sample code on github.

    Scenario1: to emphasize word.

    For example, you can use the following SSML code to emphasize the first word in a sentence:

    <speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="en-US">
        <voice name="en-US-GuyNeural">
         <emphasis level="strong">Hello</emphasis> Good Morning.
        </voice>
    </speak>
    

    In this example, the words "Hello" will be emphasized. The emphasis tag with level='strong' will emphasize the first word in the sentence.

    You can find more information about using the emphasis tag in SSML in the following documentation: https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-synthesis-markup-voice#adjust-emphasis

    Scenario 2: Higher pitch after "?"

    You can use the Speech Synthesis Markup Language (SSML) to control the prosody of the speech output. SSML tags allow you to specify the pitch, rate, volume, and pronunciation of the speech.

    And you can use the following SSML code to have a higher pitch after a "?" token:

    <speak>
    What is your name? <prosody pitch="high">Please tell me.</prosody>
    </speak>
    
    

    You can use an if-else statement to control the input text that is supposed to be read out loud. For example, if the input text contains a "?" token, you can use the SSML code with the higher pitch, otherwise, you can use the SSML code with the emphasized first word.

    I hope this helps. Let me know if you are looking for any additional information.

    Regards,
    Vasavi

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Nathalie Froissart 25 Reputation points
    2023-05-04T08:49:16.58+00:00

    Thank you for your respons, it helped alot!
    I have a follow up question. How do I make the ssml voice not speak out sertain words. Can you make a list with words or sertain settings that it should jump over(or no not say out loud) if generated from the comand promt?

    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.