12

What is the maximum length, or limits of, the SSML attribute in an Amazon Echo Alexa skill JSON response?

"outputSpeech": {
    "type": "SSML",
    "ssml": "<speak>This output speech uses SSML.</speak>"
}
robinCTS
  • 5,746
  • 14
  • 30
  • 37
Nicolas Barrera
  • 528
  • 3
  • 13

1 Answers1

16

From the JSON interface reference:

Response Format

This section documents the format of the response that your service returns. The service for an Alexa skill must send its response in JSON format.

Note the following size limitations for the response:

  • The outputSpeech response cannot exceed 8000 characters.
  • All of the text included in a card cannot exceed 8000 characters. This includes the title, content, text, and image URLs.
  • An image URL (smallImageUrl or largeImageUrl) cannot exceed 2000 characters.
  • The token included in an audioItem.stream for the AudioPlayer.Play directive cannot exceed 1024 characters.
  • The url included in an audioItem.stream for the AudioPlayer.Play directive cannot exceed 8000 characters.
  • The total size of your response cannot exceed 24 kilobytes.
Community
  • 1
  • 1
Jim Rush
  • 4,143
  • 3
  • 25
  • 27
  • 2
    I knew the info was there and it still took me a bit to find the page. ASK documentation, I think, needs a bit of a reorganization. – Jim Rush Apr 13 '16 at 15:03
  • Does anyone know if a URL can be returned in these cards? – Roberto Feb 10 '17 at 15:35
  • 1
    @Lancelot you can include whatever you want in the cards but they don't support HTML and if you include a URL it will not be a link. I use URL shortening services to provide URLs in my cards. – Josep Valls Jun 21 '17 at 15:05
  • @JosepValls Thanks for the tip. I haven't done much with this for a while. I went to a conference from Amazon and they explained why this is not supported. Hopefully they will change their mind in the future. – Roberto Jun 22 '17 at 11:11
  • @Jonathan you could generate prerecorded audio (TTS or human) and have Alexa play the file. Note file must be served up from an HTTPS connection with a valid certificate. – Jim Rush Feb 04 '18 at 12:49
  • 1
    This is what I've actually ended up doing. Using Amazon Polly via https://github.com/eheikes/aws-tts which gets around Polly's 1500 character limit. – Jonathan Feb 04 '18 at 13:51