How to return to the application from the game directive in the alexa application?

I am developing an application to erase sound. if I say alexa to play a song for this artist, alexa plays the whole song. But he does not listen to switch to another artist. Alexa ends the entire song for the artist and then stops, then I need to run the application again to listen to another artist song. How can I call another artist between songs?

here is my encoding for the first song

$speech     = "playing songs of $artistName";

$card = '"card": {
              "type": "Simple",
              "title": "Play Audio",
              "content": ""
        }';
$response = '{
        "version" : "1.0",
        "response" : {
            "outputSpeech": {
              "type": "PlainText",
              "text": "'.$speech.'"
            },
            '.$card.',
            "directives": [
              {
                "type": "AudioPlayer.Play",
                "playBehavior": "REPLACE_ALL",
                "audioItem": {
                  "stream": {
                "token": "FirstSong",
                "url": "myUrl",
                "offsetInMilliseconds": 0
                  }
                }
              }
            ],
            "shouldEndSession" : true
        }
    }';

  echo $response;

, playBehaviour ENQUEUE. , , , , . Alexa , , , , alexa .

+6
1

, . , AudioPlayer.PlaybackNearlyFinished . , .

+1

Source: https://habr.com/ru/post/1014580/


All Articles