Thanks to valuable help from Paul Webster and Michael Herger, I've got a working latency-free targeting of an Amazon Echo as a playback device for LMS. :cool: You can see a first demo of it here: https://youtu.be/ToHQRzfeZ5A
I've been testing it from a clone of the MediaServer skill called Playground so that's what you see in the video (this allows me to try out stuff and compare with the live skill under different invocation). The reason it can work is because a skill *is* authorised to clear the buffer in the Echo device and this can be done before kicking off each new song/album/playlist. Amazon does not allow anything outside of a skill to interfere with the audio of an Echo, for fear of hacking or unwanted adverts suddenly emanating from your Echo. With Paul's original mini-skill that sent an LMS stream as playlist to Alexa, people were subsequently manipulating the stream from within LMS (via e.g. iPeng or Material) and seeing huge latency because of the buffering in the Echo. What I have the luxury of doing is creating an LMS Web Client on the fly, telling it what song to play via JSON, and *then* telling Alexa to start playing that stream on the Echo with a cleared buffer. When the command is repeated to request a different song, the stream changes instantly of course but the crux is that my skill can now direct the Echo's playback queue to be cleared and the new song therefore starts immediate playback. When it's all handled within a skill, latency can be avoided. You can still change the track from the LMS GUI after starting it via voice command, but then you will of course see the latency. I still need to do some work on it to implement next/previous properly and to make the Web Client creation more robust, so it's not even in beta right now. I just thought I'd share the good news that it will be workable soon. Does anybody know JSON for creating a web client? Right now, I'm doing it with a http request to lmsserverip/stream.mp3?player=Alexa but it would be much better to be able to do it from JSON. The point in the skill where Alexa is told to stream is also the point at which the skill exits so it's not possible to do more stuff in code after that moment - that's why I need to try and pre-create the web client. One thing about this approach is that you won't be able to ask one Echo to stream from another Echo - the target will always be the Echo you're talking to which should be fine. I plan on having all the current skill's 'Play' commands have a 'Stream' equivalent where the Stream variant will target the Echo spoken to as audio sink whereas the Play command targets the 'assumed' LMS player as always. One more thing - Echo's with screens can display cover art and can also show previous/pause/next buttons so using an Echo touchscreen as a controller for LMS is also likely possible. :D ------------------------------------------------------------------------ philchillbill's Profile: http://forums.slimdevices.com/member.php?userid=68920 View this thread: http://forums.slimdevices.com/showthread.php?t=111016 _______________________________________________ plugins mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/plugins
