What is SSML?
Speech Synthesis Mark-up Language is a mark-up language that is an XML base
for speech synthesis applications. It is recommended for W3C
in voice browser applications. Furthermore, ASK supports a subset of
SSML tags.
You can use SSM
in your skill response, which will help you have additional control
over speech generation. Skill automatically handles
punctuation, like speaking a sentence ending in a question mark or
pausing for a few seconds.
Let's understand
how to construct output speech using SSML:
- // build the SSML response
- var speech = new SsmlOutputSpeech();
- speech.Ssml = "<speak>This is SSML respnose.</speak>";
- // build the response using ResponseBuilder
- var finalResponse = ResponseBuilder.Tell(speech);
- return finalResponse;
In the above example
we have created an instance of SSMlOutputSpeech. We set the value of SSML property, provided the speak tag in SSML property. You now need to
pass an instance of the same to ResponseBuilder.
Now let's
go over some of the tags.
-
Amazon effect: It helps apply effects on speech like whispering. it has name property as shown below,
- <speak>
- I want to tell you a secret.
- <amazon:effect name="whispered">I am not a real human.</amazon:effect>.
- Can you believe it?
- </speak>
- Now lets understand with example,
- // build the SSML response
- var speech = new SsmlOutputSpeech();
- speech.Ssml = @"<speak> I want to tell you a secret. <amazon:effect name = ""whispered"" > I am not a real human.</amazon:effect>. Can you believe it? </ speak >";
- // build the response using ResponseBuilder
- var finalResponse = ResponseBuilder.Tell(speech);
- return finalResponse;
In the above example,
you have set the value of name property as whispered. It speaks
the first line as usual, however, the line in <amazon: effect>
tag will be whispered.

Join the conversation! Your thoughts help the community grow.