Skip to content

Instantly share code, notes, and snippets.

@greenido
Last active July 9, 2019 14:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenido/5d57d50aa4f973a1cf610126b0441e52 to your computer and use it in GitHub Desktop.
Save greenido/5d57d50aa4f973a1cf610126b0441e52 to your computer and use it in GitHub Desktop.
An example of SSML markup and how it's read back by the Google Assistant.
<speak>
Here are <say-as interpret-as="characters">SSML</say-as> samples.
I can pause <break time="3s"/>.
I can play a sound
<audio src="https://www.example.com/MY_MP3_FILE.mp3">
didn't get your MP3 audio file
</audio>.
I can speak in cardinals. Your number is
<say-as interpret-as="cardinal">
10
</say-as>.
Or I can speak in ordinals. You are
<say-as interpret-as="ordinal">
10
</say-as> in line.
Or I can even speak in digits. The digits for ten are
<say-as interpret-as="characters">
10
</say-as>.
I can also substitute phrases, like the
<sub alias="World Wide Web Consortium">
W3C
</sub>.
Finally, I can speak a paragraph with two sentences.
<p>
<s>This is sentence one.</s>
<s>This is sentence two.</s>
</p>
</speak>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment