foo_openlyrics icon indicating copy to clipboard operation
foo_openlyrics copied to clipboard

Add support of network music stream (such as online radio) with dynamic info about track

Open oleg-babintsev opened this issue 3 years ago • 10 comments

Add support of network music stream (such as online radio) with dynamic info about track.

image

oleg-babintsev avatar Aug 17 '21 10:08 oleg-babintsev

None of the music stream/online radio sources I tried seemed to provide tag info in foobar. Can you confirm that tag info is available for you without any other components/plugins that might retrieve it?

Also could you give me an example of exactly which streams/radios you're using that provide this info?

Finally, in case I can't reproduce it, can you post a screenshot of the tag info that foobar has for that playlist item? (Right-click on it -> Properties -> Metadata tab).

jacquesh avatar Aug 17 '21 12:08 jacquesh

https://s4-webradio.antenne.de/antenne/stream

This stream shows song title & artist in foobar. The metadata fields are mostly empty tho. https://i.imgur.com/n3SFHWW.png

Big-aap avatar Aug 17 '21 13:08 Big-aap

  1. I use RadioTunes service
  2. Metadata don't contain dynamic information image

But as example, old plugin Lyrics Show Panel v3 can works with streams: image

oleg-babintsev avatar Aug 17 '21 13:08 oleg-babintsev

Hmmm, odd. I still don't get any metadata in the track list or in LSP3. I'm intrigued and I have a reasonable guess as to what I'd need to do to get this to work but its obviously difficult to try out if I can't get a radio stream working on my machine >_<

Bear with me here, these are the steps I'm taking:

  1. File->Add Location -> https://s4-webradio.antenne.de/antenne/stream
  2. Play the new item in the playlist
  3. It plays but I still just see "stream" as the title and nothing under artist/album like so: image

I get this same behaviour for every radio/stream I tried (I tried some random ones from around the internet, though it seems RadioTunes requires a subscription to use external players so I couldn't try that). Am I missing a step or do doing something wrong here? >_<

jacquesh avatar Aug 17 '21 16:08 jacquesh

Hi,

I have fresh installation of foobar v1.6.7 (and on previous versions I always had the similar behaviour). Test of https://s4-webradio.antenne.de/antenne/stream with Lyrics Show Panel v3: image

All works fine :)

oleg-babintsev avatar Aug 18 '21 14:08 oleg-babintsev

Could it be related to dynamic track titles setting? See here.

anazzani avatar Aug 24 '21 06:08 anazzani

Thanks anazzani,

I confirm, if option "Enable dynamic track titles" is off the artist and title didn't detected by foobar playlist and by LSP3.

image

oleg-babintsev avatar Aug 24 '21 08:08 oleg-babintsev

Oh sweet, yeah now it gets the info for me. Thanks for that info, I'll look into getting that info into the lyric search then!

jacquesh avatar Aug 27 '21 09:08 jacquesh

For future reference, I'm kinda waiting for some help with how to get this information. I have asked on the fb2k forums here: https://hydrogenaud.io/index.php?topic=121479

I could get around this by holding onto the dynamic track info returned in the on_playback_dynamic_info_track callback but it'd be rather tedious and require a significant amount of re-arranging the data flow.

jacquesh avatar Oct 14 '21 17:10 jacquesh

You don't get it from the info arg that is passed to the callback. You have to use playback_format_title from playback_control.h like was mentioned on the forums.

Assuming you had these as members of a class derived from play_callback_static.

pfc::string8 m_artist, m_title;

then...

void on_playback_dynamic_info_track(const file_info&) override
{
	titleformat_object::ptr obj;
	titleformat_compiler::get()->compile_safe(obj, "%artist%");
	playback_control::get()->playback_format_title(nullptr, m_artist, obj, nullptr, playback_control::display_level_all);

	// then do the same again to get the title
}

marc2k3 avatar Oct 23 '21 04:10 marc2k3

fyi I've added this to the list for v1.4 (not the next release, the one after that), or at least to revisit it using the new metadb v2 available in upcoming fb2k v2.0 beta (https://wiki.hydrogenaud.io/index.php?title=Foobar2000:Development:SDK_2022-08-10_Release_Notes)

jacquesh avatar Oct 09 '22 15:10 jacquesh

Just to update those watching & waiting for this feature: I know I said this would be done for v1.4 but I've moved it to v1.5 because 1.4 is a bugfix-only release that I wanted to get out soon (because it fixes a bug that could cause data loss for some lyrics) and supporting internet radio streams requires some significant changes to the way openlyrics manages things internally. On top of that I'm unlikely to have any time to work on openlyrics for the next little while so I didn't want to release a new version with higher-than-usual potential for bugs and then not be around to fix it if anything critical came up.

On the upside, I have made a start on supporting this and indeed the new APIs provided by the recent fb2k updates do make this much easier to do. So this will get done, you'll just need to wait for a slightly higher version number. Thank you all for your patience!

jacquesh avatar Nov 19 '22 11:11 jacquesh