You can send Speech Synthesis Markup Language (SSML) in your Cloud Text-to-Speech request to allow for more customization in your audio response by providing details on pauses, and audio formatting for acronyms, dates, times, abbreviations, or text that should be censored. See the Cloud TTS SSML tutorial for more information and code samples.
The following shows an example of SSML markup and the Cloud TTS synthesizes the text:
<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>
Here is the synthesized text for the example SSML document:
Here are S S M L samples. I can pause [3 second pause]. I can play a sound [audio file plays]. I can speak in cardinals. Your number is ten. Or I can speak in ordinals. You are tenth in line. Or I can even speak in digits. The digits for ten are one oh. I can also substitute phrases, like the World Wide Web Consortium. Finally, I can speak a paragraph with two sentences. This is sentence one. This is sentence two.
The Cloud TTS supports a subset of the available SSML tags, which are described in this topic.