actions-on-google-nodejs icon indicating copy to clipboard operation
actions-on-google-nodejs copied to clipboard

Custom shuffle/loop intents end audio playback

Open lukelafountaine opened this issue 5 years ago • 1 comments

I have tried to implement custom shuffle and loop intents for my action that has audio content. The platform does not seem to support this.

The ideal behavior would be like this:

> "OK Google, tell 'my cool action' to play music"
< "Playing music..." 
> "OK Google, turn loop on"
< "Turning loop on"
Music continues playing

Instead, this is what happens:

> "OK Google, tell 'my cool action' to play music"
< "Playing music..." 
> "OK Google, turn loop on"
< "Turning loop on"
Music stops

Even worse, after the latter scenario, since the session with my action is over, restarting the audio ("OK Google, play") will only play through the current track and my fulfillment endpoint will not get a request to play the next song. The custom shuffle and loop intents will also not be invoked. Instead, the built-in intents for shuffle and loop are invoked.

The reason this is happening is because we have two options when sending a speech response:

  1. Await a user response and keep the mic open
  2. End the session and turn the mic off.

Option 1) Awaiting a user response doesn't make any sense in this scenario because there is nothing for the user to respond with after they just asked for loop/shuffle to be turned on/off. This continues to prompt them 3 times until Google gives up and closes the session.

Option 2) Ending the session makes more sense but it also ends the currently playing audio track.

Is there any plan to support something like this? Or is there any usable workaround for this?

lukelafountaine avatar Jul 18 '19 14:07 lukelafountaine

It should be noted that turning loop and shuffle features on and off is natively supported by Alexa, which is why we're sort of monkey-patching it into our Google intents to try to keep feature parity.

jthomerson avatar Jul 19 '19 03:07 jthomerson