Search code examples
ruby-on-railsalexa-skills-kitalexa-voice-service

Navigate from one Intent to another Intent in Alexa


I am using ralyxa to work with Alexa. I have an audio, and have something else to do when this audio finishes.

As usual, the alexa triggers PlaybackFinished Intent. But this intent does not include any standard properties such as outputSpeech, card, or reprompt (This is what documentation says). I cannot trigger an output speech.

Is there any way to trigger a custom Intent, something like the following, which calls CustomIntent inside PlaybackFinished Intent?

intent 'AudioPlayer.PlaybackFinished' do
  speech = PODCAST_REPEAT_OPTION
  CustomIntent
end

Solution

  • For a AudioPlayer.PlaybackFinished request you cannot send a response with

    1. outputSpeech or reprompt
    2. Any other AudioPlayer directives
    3. Any other directives from other interfaces.

    Your skill can only respond with a Stop or ClearQueue directive to stop or clear the current audio playback queue.

    However, before you get a AudioPlayer.PlaybackFinished, you will receive a AudioPlayer.PlaybackNearlyFinished to which you can send a Play directive (or any AudioPlayer directive.) to continue streaming audio.

    Standard response properties such as outputSpeech, card, and reprompt with AudioPlayer directives are possible when responding to a LaunchRequest or IntentRequest.