stanford-oval / genie-toolkit

The Genie open source kit for voice assistant (formerly known as Almond)
Apache License 2.0
194 stars 35 forks source link

(Staging) "play" should resume playback in Spotify after pause #703

Open tonyespinoza1 opened 3 years ago

tonyespinoza1 commented 3 years ago

This is a simple one.

play thriller

I played Thriller on Spotify. pause

I paused playback. play

Sorry, music is already paused.

====
# main/d536f7d0-7a9c-4220-a705-ad0c308efe06
#! timestamp: 2021-07-18T03:08:06.521Z
U: play thriller
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-source.playable() filter id =~ "thriller" => @org.thingpedia.media-player.play(playable=id);
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: (@org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter id =~ "thriller")[1] => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:7azo4rpSUh8nXgtonC6Pkq"^^org.thingpedia.media-source:playable("Thriller"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
#! timestamp: 2021-07-18T03:08:07.693Z
A: I played Thriller on Spotify.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-18T03:08:18.795Z
U: pause
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-player.player_pause();
C: $dialogue @org.thingpedia.dialogue.transaction.execute;
C: (@org.thingpedia.media-source(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).playable() filter id =~ "thriller")[1] => @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).play(playable=id)
C: #[results=[
C:   { value="2faa93e1b2b45b85b02b90b497d311c37e7659e7", display="Soundworks’s Mac Pro", playable="spotify:track:7azo4rpSUh8nXgtonC6Pkq"^^org.thingpedia.media-source:playable("Thriller"), __device="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza") }
C: ]];
C: @org.thingpedia.media-player(id="com.spotify-126743886"^^tt:device_id("Spotify Account of Tony Espinoza")).player_pause()
C: #[results=[]];
#! timestamp: 2021-07-18T03:08:19.192Z
A: I paused playback.
AT: $dialogue @org.thingpedia.dialogue.transaction.sys_action_success;
#! timestamp: 2021-07-18T03:08:24.567Z
U: play
UT: $dialogue @org.thingpedia.dialogue.transaction.execute;
UT: @org.thingpedia.media-player.player_pause();
====
tonyespinoza1 commented 3 years ago

checking this one... the desired behavior between the sequence of "pause" followed by "play" would ideally maintain the playhead/timeline position. currently restarts the song.

gcampax commented 3 years ago

"play" is currently treated the same as "play some music", which will pick some popular music to play and reset the queue. It is not the same as "resume playback", which will resume playback from whatever it was before.

If we want the exact word "play" to mean "resume", I think this issue will go together with #704 where we introduce generic "play" / "pause" / "next" / "previous" commands similar to "stop", independent of the normal training.

tonyespinoza1 commented 3 years ago

simplest fix for now: it would help if Genie said that they "stopped" the music rather than "paused playback."

gcampax commented 3 years ago

Workaround is now merged, it should be deployed in a couple hours.