#Guidance on media player music playback

1 messages · Page 1 of 1 (latest)

unreal berry
#

So I have my Voice PE and a Respeaker Lite working quite well.

One thing I’m struggling with however is media players. I can change volume, pause etc arbitrary players fine but I’m struggling to get music to play. This makes sense in many ways since music sources are diverse. My main source of music is my LMS install, and the squeezebox integration very nicely exposes the LMS database into the media sources system. So it seems a bit odd that there is no intent, if that’s the correct term, for getting music out of the media sources.

I’ve worked around this, partly successfully, using a custom automation with a bunch of sentence triggers, but it’s not the ideal solution at all.

Are there any folks out there who have successfully got music playback controllable through their voice?

One side question: how can I selectively disable bits of the built in intent behaviours? Basically if I’m to continue down the road of a custom automation I’m probably going to need chunks of the supplied media player voice control disabled so if a user says a command that isn’t known to my custom automation but is known to the build in commands it’s ignored instead of giving a response that just confuses the user.

radiant geyser
#
  1. Your custom intents will take precedense over inbuilt ones, as soon as they match the recognized speech.
#
  1. There's a way to use voice with Music Assistant (moreover, looks like it will be official way to play music on HA, so i'd jump there ASAP)
#
  1. You may do it like i do: I've created bunch of scripts that search exact album/track on MA database. I use LLM for getting user speech refined, then search in MA database and play it.
unreal berry
#
  1. The problem is I don’t know where the list of inbuilt intents is.
  2. I’ve looked at MA. The problem is it doesn’t have a LMS integration. It can replace a LMS (mostly) but it will leave my old non Linux based squeezeboxes in a half working state. So MA isn’t really an option.
  3. This is basically what I’m doing with the LMS HA integration, but the sentence matching is klunky and not really workable in practice.

The oddest part of it, to my mind, is that the LMS integration populates the media sources so music playback should really be “free”.

I can see MA taking over music duties from the core of HA. But if that happens I imagine poor old LMS users will be left behind.

radiant geyser
# unreal berry 1. The problem is I don’t know where the list of inbuilt intents is. 2. I’ve lo...

Well, things are moving forward, and something is going to become obsolete sooner or later.
But if LMS integration has search, you can play whatever you want. Just ask chat GPT to extract correct album/track/artist from your request. And use script to search and play it.

The oddest part of it, to my mind, is that the LMS integration populates the media sources so music playback should really be “free”.

Well there's no intents for music playback in HA. Partially because it's pretty hard to achieve, partially because intents are still too young.
So you'll have to write your own.

unreal berry
#

I shall continue plugging away and see how far I can get.

Part of the “problem” (it’s more accurate to say it’s what makes it fun and satisfying) is that everything is in flux. The split between MA and HA is a great example of this. Even without LMS (which is I think a fairly old integration for a 25 ish year old bit of software) it’s unclear how and why HA and MA overlap, before you even look at voice. It’s all a bit of a swamp, for want of a better and kinder expression.

Like you say it’s young, and I think music is at the new end of that. I’m hoping that someday the common use cases will be met without too much effort on the users part. “Play some ABBA from Spotify in the livingroom” etc.

So I’m off to learn about intents.

versed venture
#

I have that working on my end with an llm like formatBCE mentions, and i think MA plans to release blueprints for voice command intents soon, maybe those can act as a guide to make your own 🙂

unreal berry
#

I have this mostly working. But one thing I can’t figure out is getting a difference response out of the script when no match is found?

rancid lance
#

I'd be very interested in seeing your scripts when you're happy with them - i just started looking at the same thing. BTW, I have a PR open on the squeezebox integration to add direct search and play actions, which might make life easier. I don't know the intent side of things well (or really at all) yet - my PE is my first foray into voice and it's still in its box - but if there are specific requirements from the integration that would make life easier, I'd be happy to take a look (not least because I'm likely to want them down the road .... - I'm one of the maintainers of the integration...)

radiant geyser
rain swan
#

FYI I have local LMS playback triggered through assist by exposing a search and then play script I’ve made. ChatGPT can figure out pretty well how to fill out the variables.
Ping me tomorrow if I forget to share the script (sitting in a rocking chair trying to get my baby to sleep so cannot make a gist right now 😛 )

radiant geyser
rain swan
#

You should change the media players select options obviously 🙂

unreal berry
#

@rain swan looks awesome ! I shall give it a spin. It looks more sophisticated then my script, which just uses “playlist insertalbum” to manipulate the active playlist, so if a match isn’t found then the playlist ends up empty. I’m also struggling with entities vs areas. Would like to support both in the spoken command but am struggling with that too. 🙂 It’s a lot of fun though and even with my poor script it works great most of the time.

rain swan
#

I had a really hard time figuring out how to actually query LMS. Had to find some obscure old forum threads to just get it where it is.
One thing that’s missing is I would love to be able to query spotty as well as a fallback to the local collection, but I have no idea how, and the documentation is lacking.

unreal berry
#

The calls were all designed around the LMS web UI I guess. They didn’t have voice control in mind when they came up with it.
I’ll have a bigger play with your script later today but so far it looks way better then my attempt. 🙂
Yeah Spotify would be awsome. I haven’t looked at the HA integration but I assume it’s no help?
I’ve never really understood how Spotty works. It seems to add previously played tracks into the LMS database? But I’m guessing none of that helps with searching for new tracks/albujs/artists.

rain swan
#

I’ve looked at the Spotify ha integration and it doesn’t look like it supports searching, only starting playback on media players using an id you get by searching manually on the Spotify web ui.
But feel free to ping me here if you use the script and find out ways to improve it 😄

rain swan
#

I cracked the Spotify 🥜.
I’ve updated the script to call a fallback script if LMS locally cannot find anything. The fallback script requires you to have the SpotifyPlus integration (on HACS) installed. It queries Spotify using that integration but initiates playback on squeezebox.

https://gist.github.com/antontanderup/b55719b57d58cc81e221101d087e631c

Gist

Home Assistant script to search and initiate playback on a lyrion music server (lms) player. - play_on_lms_speaker_query.yaml

unreal berry
#

Wow I’ll give that a look, cheers!

#

I don’t use HACS but it looks like SootifyPlus has a manual install option. Phew.

radiant geyser
unreal berry
# rain swan I cracked the Spotify 🥜. I’ve updated the script to call a fallback script if L...

That works just smashing. SpotifyPlus is terrific! I have yet another way to control Spotify now. 🙂
One thing I’ll see if I can add is playback of a particular playlist.
I’m not using the “front line” local search in my script, just Spotify. I still use local playback every day using iPeng but the voice stuff is for Mrs Aslak3 who mostly just uses Spotify. I’d cancel it if I could. 😉
Thanks for all your efforts! I’m gonna look through the service calls erm Actions you get with SpotifyPlus now…

rain swan
south drift
#

Hi Everyone - Author of SpotifyPlus here. Just poking around on the Discord forum, and ran across this thread. I am not into Voice commands (yet), but I had a guy post on the SpotifyPlus discussion forum about some Voice PE stuff; he had a script out there that could transfer playback and such, as well as do some searching of the Spotify catalog. I thought you guys might be interested. Glad to hear people are getting some use out of the integration. Hope it helps!

GitHub

Voice Assist automation I've been working on an initial little Assist automation to control SpotifyPlus using voice intents. It's currently highly experimental and not very tested. It works...

old ore
#

Not sure if this is still relevant, but I've recently been playing around with this as well. What I still haven't gotten to work is to (reliably) play a specific radio station. What does work fine, though, is to have MA play a band, and album, or a song. These blueprints here are working wonderful for it - I went with Option #1, since my LLM is too slow & small, but your mileage may of course vary: https://github.com/music-assistant/voice-support

GitHub

Music Assistant blueprints . Contribute to music-assistant/voice-support development by creating an account on GitHub.

rain swan
#

If I recall correctly this thread ended up being about getting search and play up and running to start LMS playback (not MA).
MA (with blueprints) simply works excellent, but not everyone can/wants to run MA.