Text-To-Speech messages

For Text-To-Speech or Text-To-Speech Prompts, you use the text request parameter to control:

  • The message delivered to your user.
  • The pacing of your TTS.

To control the way this text is spoken:

  • A comma (,) - introduces a small pause:
    Please enter your activation code 9, 0, 9, 0, in the next 20 minutes.
  • <break> - gives a longer pause. Set the time in seconds (s) or milliseconds (ms):
    Please enter your activation code 9, 0, 9, 0, in <break time="1s"/>20 minutes.
  • <prosody> - changes the speed of speech:
    The price of XYZ is <prosody rate="-10%">$45</prosody>
  • <audio> - play an audio file (.wav or .mp3) as a message:
    <audio src="http://static1.grsites.com/archive/sounds/animals/animals011.mp3"/>
    You can include more than one audio tag in your message, the audio file MUST be a public URL.
  • Combine audio and text:
    <audio src="http://example.com/balance-greeting.mp3"> 145.89 <audio src="http://example.com/currency.mp3">

Note: Nexmo use both HEAD and GET methods to retrieve audio files, you must handle both. If Nexmo cannot retrieve all the audio files in your request within 5 seconds, a 3 response code is returned.

Previous   Next