1. Home
  2. Docs
  3. Tutorials
  4. Including Pre-Recorded Audio in your Conversational Application Response

Including Pre-Recorded Audio in your Conversational Application Response

The SSML audio tag lets you provide the URL for an MP3 file that your voice conversational application; Alexa skill, Google Home action, or your Voicebot can play while rendering a response. For example, you can play a short recorded audio information about a stock, or provide an answer with a different voice than the default one using a text-to-speech service.

To send an MP3 response you can use the following code:

res.say('<audio src="https://docs.conversation.one/wp-content/uploads/2017/12/happyBirthday.mp3" />');

Notes:

  • The MP3 must be hosted at an Internet-accessible HTTPS endpoint. You can host your files on Conversation.one media server.
  • The MP3 must be a valid MP3 file (MPEG version 2).
  • The audio file cannot be longer than ninety (90) seconds.
  • The bit rate must be 48 kbps. Note that this bit rate gives a good result when used with spoken content, but is generally not a high enough quality for music.
  • The sample rate must be 16000 Hz.

 

Was this article helpful to you? Yes No

How can we help?