lordpengwin / muzak

Amazon Echo Skill for Logitech/Squeezebox Media Server
MIT License
35 stars 16 forks source link

Support for playing artists, albums, genres and playlists #10

Closed heylookltsme closed 7 years ago

heylookltsme commented 7 years ago

What

Major change:

Minor changes:

Testing

0) This depends on an update to squeezenode that was merged today, so rm -r node_modules/ && npm install to get the latest stuff.

1) I found the lambda-local module very helpful for testing my local code. After npm installing, you can run a test like so -

lambda-local -l muzak.js -h handler -e test/playAlbum.fixture.json

You might need to adjust the test fixture to use music from your library.

2) You can also test the AWS Lambda response with claudia -

claudia update && claudia test-lambda --event test/playAlbum.fixture.json

3) You can test the whole thing, end-to-end, by updating both your AWS Lambda function (either via claudia or manually) and the intents and utterances in your Alexa skill. Then speak a command to Alexa like, "Alexa, tell squeezebox to play the album Revolver."

Notes

This is a good start, but it is flawed! The biggest issue is that apparently the LMS API is case sensitive, if you can believe it.

I had a big headache when my local testing worked great, claudia testing of the remote function worked great, but then actually talking to Alexa was failing. It came down to the difference between "Revolver" vs "revolver." Insane. Soooo... if your music metadata is a mess, this might not work at all. This seems to suggest that it might be necessary to write a set up script that uses the users LMS database to generate custom slot values rather than use a literal value. Assuming, of course, that the custom slot value will also be case sensitive, otherwise we gain nothing...

EDIT: Another issue is that the the LMS API doesn't provide any success or failure feedback beyond the success or failure of the actual request. So, if you ask to play an album that you don't have, the request submits successfully and we get no feedback that the album actually doesn't exist. One thing we could do is maybe search first before calling loadalbum, but I'm worried the latency would be too significant there.

I'm certain there will be other issues as well. In my local testing, requesting the artist "Sleater-Kinney" works, and requesting the album "Dig Me Out" works, but requesting the album "Dig Me Out" by "Sleater-Kinney" fails. I don't know why. :/

Please test and leave feedback! Thanks!

cc: @lordpengwin @MikeDeSantis @glacket

MikeDeSantis commented 7 years ago

Fantastic work! I can't wait to try out the new functionality. Truly exceptional programming, and so quickly.

-Mike

On Mar 24, 2017, at 7:13 PM, Corinne Hoener notifications@github.com wrote:

@heylookltsme commented on this pull request.

In speechAssets/utterences.txt:

+PlayPlaylist play album {The Places You Have Come to Fear the Most|Album} in {Player} +PlayPlaylist play the album {Revolver|Album} by {The Beatles|Artist} in {Player} +PlayPlaylist play the album {Abbey Road|Album} by {The Beatles|Artist} in {Player} +PlayPlaylist play the album {Dig Me Out|Album} by {Sleater-Kinney|Artist} in {Player} +PlayPlaylist play the album {Never Lose that Feeling|Album} by {Swervedriver|Artist} in {Player} +PlayPlaylist play the album {He Who Saw the Deep|Album} by {iLiKETRAiNS|Artist} in {Player} +PlayPlaylist play the album {Push Barman to Open Old Wounds|Album} by {Belle and Sebastian|Artist} in {Player} +PlayPlaylist play the album {The Places You Have Come to Fear the Most|Album} by {Dashboard Confessional|Artist} in {Player} +PlayPlaylist play album {Revolver|Album} by {The Beatles|Artist} in {Player} +PlayPlaylist play album {Abbey Road|Album} by {The Beatles|Artist} in {Player} +PlayPlaylist play album {Dig Me Out|Album} by {Sleater-Kinney|Artist} in {Player} +PlayPlaylist play album {Never Lose that Feeling|Album} by {Swervedriver|Artist} in {Player} +PlayPlaylist play album {He Who Saw the Deep|Album} by {iLiKETRAiNS|Artist} in {Player} +PlayPlaylist play album {Push Barman to Open Old Wounds|Album} by {Belle and Sebastian|Artist} in {Player} +PlayPlaylist play album {The Places You Have Come to Fear the Most|Album} by {Dashboard Confessional|Artist} in {Player} +PlayPlaylist play genre {rock|Genre} I couldn't think of any three-word genres... can you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lordpengwin commented 7 years ago

Great job! I suspect as you said that generating the list of album utterances may be the way to go.

heylookltsme commented 7 years ago

Thanks guys! I hope it works well enough for now. Please let me know what trouble you run into, because it's definitely not gonna be perfect.

I was actually just surprised by something that I thought would never work. I just asked Alexa to play the artist Sun Kil Moon. I assumed it would never work because she would hear "sun kill moon" (note the two L's in "kill"). But for whatever reason, she interpreted it correctly and sent the value "sun kil moon" to lambda and it started playing!

I have no clue how that possibly worked lol. /shrug