Feature description:
Add support to configure external APIs to provide internet radios with metadata when they don’t include it in the stream itself.
Problem solved:
While some internet radios include metadata (currently playing song and artist) within the stream (which Symfonium already displays), others do not.
For example BBC Radio 6 music (which my sister listens to a lot) does not include metadata in their streams (to my knowledge).
I’ve used this to find the best stream quality:
And ended up with this stream:
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_6music/bbc_6music.isml/bbc_6music-audio%3D320000.norewind.m3u8
Adding that in Symfonium as an internet radio works fine, however no metadata is displayed when playing it, which prevents scrobbling correctly and also means a lack of information.
After googling a bit I found that some people over at Roon managed to get Metadata for it working by using an API which returns information about currently playing and last played songs in json.
Roon thread:
direct link to the API:
https://rms.api.bbc.co.uk/v2/services/bbc_6music/segments/latest
After tinkering with the api in python a bit I ended up with this script which prints what’s currently playing:
import requests
def get_current_song_info():
url = "https://rms.api.bbc.co.uk/v2/services/bbc_6music/segments/latest"
try:
response = requests.get(url)
data = response.json()
if 'data' in data and len(data['data']) > 0:
primary_title = data['data'][0]['titles']['primary']
secondary_title = data['data'][0]['titles']['secondary']
if primary_title and secondary_title:
return f"Currently playing: {secondary_title} by {primary_title}"
else:
return "No song information available"
else:
return "No segment data available"
except Exception as e:
return f"Error: {e}"
print(get_current_song_info())
“Currently playing: Motion Sickness by Hot Chip”
would be an example output.
For this specific example it would also be possible to use the last.fm api instead as the radio scrobbles what’s currently playing:
That would also allow not only getting artist and title but the album to be displayed and used in Symfonium as well.
However I don’t know how hard a feature like this would be to implement, if it’s too complex or bears risks, just tell me. It’s in the nice-to-have-and-would-be-very-neat category.
The implementation should not be specific for 1 radio, otherwise it would be impractical to implement more radios in the future.
Brought benefits:
Allow advanced users to configure api calls for radios that don’t include metadata in their streams.
To share knowledge a subsection for preconfigured radios with their corresponding api calls could be added to the forum so that users could share their results and allow less advanced users to quickly add a radio + metadata.
Other application solutions:
The aforementioned Roon solution is the only one I’m aware of.
Additional description and context:
What I imagined was adding a url to the API and then adding which json elements of the json response represent artist, track and (if it exists album) to keep it universal and not specific to one radio.
Screenshots / Mockup: