hifiberry / audiocontrol2

A controller application that can handle multiple concurrent media players
MIT License
46 stars 20 forks source link

Interface to play specific item from specific source #26

Closed escoand closed 2 years ago

escoand commented 2 years ago

I'm looking for an interface to start playing a specific radio stream, Spotify playlist, local file or DLNA resource by an extension. I haven't found something like that in the players subdir. It seems the players are just able to stop/pause/play the current track. Am I missing something?

My use case is to create something similar like http://phoniebox.de/index-en.html, which has many features but the whole installation, configuration and update procedure seems to be quite hacky. I like the straightforward out-of-the-box experience of HiFiBerry. With phoniebox you're able to create M3U files or folders with the name of the RFID tag and this starts to play when getting scanned. I've already implemented a RFID tag reader based on ESPHome and an ac2 plugin reading commands passed through the serial interface. But I can't find a way to plays some specific item.

May I ask for some kind of pointer in the right direction?

pinballpower commented 2 years ago

It seems the players are just able to stop/pause/play the current track.

Yes, that's all audiocontrol supports today.

escoand commented 2 years ago

But there has to be some kind of interface. The frontend is doing it exactly in that way. But I'm not able to find the code.

hifiberry commented 2 years ago

The only source that you can start media playback on HiFiBerryOS is mpd - meaning local files and web radio streams. This is handled by mpd. No other functionality (e.g. DLNA, Spotify) exists in HiFiBerryOS.

escoand commented 2 years ago

But this is also not implemented in ac2, right?

hifiberry commented 2 years ago

Exactly, this is implemented by directly interfacing mpd

escoand commented 2 years ago

For anybody also interested in this use case: I've implemented a plugin which is doing exactly the same as the mentioned PhonieBox - you can scan a RFID card to play a playlist: https://gist.github.com/escoand/cc73b94305d24f1ab70bae1f0dd5cb39 It is working with a generic MPD playlist and also with a playlist of Spotify URIs.