New Binding: Music Assistant

I noticed something interesting. Maybe vou could look into it?

When I send audio through a Sink from OpenHAB, it is always played as notifocation and in one instance will be canceled after a few minutes while still about half an hour of playtime remains.

Could you add the opportunity to send audio to notification or the music queue by choice? So maybe a channel to send an URL to the music stream.

The audio sink that this binding exposes uses the Music Assistant “announcement” api to interrupt the audio being streamed in order to play an announcement. It’s not intended to (and the behavior you describe seems to confirm this) act as a general purpose feed of audio into music assistant.

What I think you’re looking to do is actually quite complicated: the current binding doesn’t have queue management capability because that functionality doesn’t really map onto openHAB’s item based approach to doing things. You’d also need to have a way to add a stream to Music Assistant’s library before you could then add it to a queue to play. You’d probably also need to remove it after it had played since the streams that openHAB generates are only playable one time.

Maybe you can explain what you’re trying to send through the audio sink that’s so lengthy? I’m not aware of anything in openHAB that normally generates such audio.

Well explained. Thanks for that.

Some years ago I build a OpenHAB based device to play children’s audio books on the smart speakers. It lacked an announcement feature.

Using the Music Assistant I hoped to bypass this shortcoming.

I can absolutely use a cromecast sink for this single device without issue though. Just wanted to ask to be sure.

As I do not want to use the Music Assistant Library to house the audio files this option is unfeasable - for most people I guess it would work.

Ok, I think I follow now. I think that confirms that using the announcement feature is probably not what you want.

I think Music Assistant has a way to /send/ audio to it using its “Sendspin source” feature, and then you can route the audio back out to a desired player. Sendspin is a new and developing feature, and I’m not sure how easy it would be to get the rest of the solution if I put together an audio sink for that…there’s a java library for sendspin, but I haven’t researched yet if that’s receive only. I think that’s a potentially useful feature, so I’ll put it on the to-do list for when I have some free time.

Thanks for your feedback and I’m sorry it doesn’t (yet) solve your problems. Keep checking back here, hopefully there will be some improvements that make this possible.