I am trying to play an audio file through Alexa. My backend in Ruby on Rails and I am using alexa-ruby gem.
I was able to produce speeches via ask and tell directive like this
def index
parsed_request = JSON.parse(request.body.read)
alexa = AlexaRuby.new(parsed_request)
speech = "Hey there! I am alexa"
response = alexa.response.ask!(speech)
render json: response
end
When I tried to play audio, I am getting no response. This is what I tried to do
def index
parsed_request = JSON.parse(request.body.read)
alexa = AlexaRuby.new(parsed_request)
params = { url: 'https://s3.amazonaws.com/my-ssml-samples/Flourish.mp3', token: 'flourish-token', offset: 0 }
response = alexa.response.add_audio_player_directive(:start, params)
render json: response
end