sjmog / ralyxa

A Ruby framework for interacting with Amazon Alexa.
MIT License
180 stars 24 forks source link

Default to using SSML #12

Open sjmog opened 6 years ago

sjmog commented 6 years ago

Wrap response text in a <speak> tag by default. This means that there will be no need to designate SSML usage: it'll 'just work':

respond("Hi there") # => "<speak>Hi there</speak>"
respond("<say-as interpret-as="spell-out">hello</say-as>") # => "<speak><say-as="spell-out">hello</say-as></speak>"

If the user writes SSML with <speak> tags, strip them out, as nested <speak> tags break Alexa.

sjmog commented 6 years ago

This also means we can remove any references to ssml: true, which removes a parameter from respond (thank goodness)