FLAC streams for radio

I see that there are now some flac streams available - but I do not see them listed in the v2 API 
at
http://api.sr.se/api/v2/audiourltemplates/liveaudiotypes

Will they appear there at some point (if yes - can you say when this might be)
?
If not - will there be a new API to list them?
Paul Webster

Kommentarer

  • Hi Paul!
    There is only one Flac-stream that we hade communicated towards listeners yet, and that is P2:
    https://live1.sr.se/p2-flac

    The Flac-stream of P2 is not included in our API as it is an experimental stream, but the experiment is solid enough to be communicated towards our audience. As we are testing various settings within the boundaries of a pilot project (a new streaming platform), you might find the stations P4 Plus and Radioapans Knattekanal in Flac as well, but those streams are not communicated towards the audience and might come and go more often than the more solid P2 in Flac.

    The ID:s listed in api.sr.se/api/v2/audiourltemplates/liveaudiotypes should be applicable on all of our stations, and thus the Flac-stream is not suitable there. And ... there is no need for an API to list one single stream:
    https://live1.sr.se/p2-flac (http:// is also working)

    Interesting how quickly the rumor of our "Flactivity" is spread!
    Annika Webbmaster
  • Thanks. I saw the post about the flac stream in one of the other (non API) posts.
    I use your API to generate data for my “Radio Now Playing” plugin for Logitech Media Server (LMS).
    I have made a quick manual update to add the higher rate flac and aac streams to the next beta update that I will push out later today.
    I have no idea how many listeners come via it (look for slimserver in your streaming logs) but would be interesting to see if it leads to some more high rate listening.
    I use your APIs to get song data as well (not using the embedded metadata). Unfortunately it is quite a long way behind the audio (90 seconds to a minute). I do not remember if this has always been the case.
    Paul Webster
  • Nice with the LMS plug in!
    Most Logitech-users I have been in contact with uses the mysqueezebox.com (and their Tunein function), but when I get in touch with LMS-users that might benefit from your plug in, I will let them know about it!

    The delay issue is a bit tricky. At the moment we have different latency for different stations (due to the pilot) and it also varies with bitrates and audio format. I have to check with the technicians who work more closely to the streaming process and get back to you next week! (If i recall a conversation correctly, we deliberately have extra latency on the Flac-stream.

    I understand that you use the streams (except from P2 in Flac!) via the API. Are you using any playlist (M3U or PLS)? Which formats and bitrates?

    Off topic:
    One Logitech-user I have been in contact with had a wish for a function that we no longer provide. I have hoped that some creative person should develop plug in that solves his issue:
    Podcast: Favorite to latest Epsiode - Squeezebox : Community : Forums (slimdevices.com)

    If you are looking for a new audio-project (or are in contact with developers who are), solving this would make Jasell (and obviously Cadster as well) very happy ...

    Have a nice weekend!
    Annika Webbmaster
  • I provide links directly to the streams (for mp3 something like h t t p s : / / http-live.sr.se/p1-mp3-192) and to the .m3u8 for the hls.
    However, I am not using the station list dynamically. Currently I ship the plugin with the stream URLs included in the plugin data. However, I made the list by using your API.

    Thanks for the link to the podcast question - I have posted to it with a question to see if the participants are still around.

    Attached is an example while P4 Plus is playing

    Paul Webster
  • also - ignore my comment about song timing being incorrect in the data returned from the API ... I just looked at the raw data will streaming and the timing was accurate - although the data appeared a bit late (I'll try with a URL uniquifier just in case it is being cached at an intermediate point).

    Anyway - I then took another look at my configuration data and I saw that I had put in a 70 second delay for your stations ... I assume it was because that is what I found I needed before (mid-2022) ... so I took it out and now (at least for P4 Plus) the end times are exactly correct.
    Paul Webster
  • Hold your horses!
    As I wrote, the latency in our pilot stations (P2, P4 Plus and Radioapans knattekanal) are different from all the others.

    I will get back to you next week, because this very moment my much needed weekend starts.
    Annika Webbmaster
  • I use your APIs to get song data as well (not using the embedded metadata).
    Embedded metadata is available on the stations that are part of the pilot: P2, P4 Plus and Radioapans Knattekanal. For these stations, using the embedded metadata instead of http://api.sr.se/api/v2/playlists/rightnow?channelid={id} can solve the problem of mismatching due to different latency than the "non pilot-stations".
    Annika Webbmaster
  • Thanks

    I had seen that the embedded ICY StreamTitle was accurate.

    I can configure my plugin to try to use both but it leads to problems when the API data is a long way out of sync with the ICY data because (at least at present) it is the most recent data that wins ... so it results in me setting the song info back to what it was before for about 50 seconds.

    Also - the ICY data does not provide the extra stuff like start/end times and cover art link that I get via your API. It is not a big issue because when I later get it from the API then I use it.

    Anyway - I'll try it again and see if I can tweak things to make it a bit more seamless.
    Paul Webster
  • A related thought ... I am cheating a bit and using
    playerajax/audiometadata
    because it has the link to cover art (if it points to the fallback art then search elsewhere to find some).
    I would use
    api/v2/playlists/rightnow
    if it had albumarturl in it - then I could also expose the album name and label to the listener.
    Alternatively ...if you could add albumname and recordlabel to playerajax then that would be great as well.
    Paul Webster
  • Hm ... I need to check this with our specialists!
    /The generalist
    Annika Webbmaster
  • The specialist has spoken, and he said:
    We will not add album art nor album name + record label in the sources in the near future.
    Does the playerajax/audiometadata use some kind of audio fingerprint-service? With many stations presenting the content in different manners, a fingerprint-function seems to be a good way of solving this. It's not cheating. It is pragmatism!

    Does most of the stations you have included provide an API? Is there any station that has a really good API (or a nice documentation of their API) we can be inspired of the next time we give som love to our API (content and/or documentation)? Unfortunately I guess that too is not going to happen in the nearest future, but when it happens, I want it to be easy to use both for rookie-developers and experienced developers like you!
    Annika Webbmaster
  • The playerajax/audiometadata reference is what your own web site player that is at the bottom of your home page.
    It returns details of the currently playing programme and a set of songs with timestamps - and the song info looks like this:

    {
    "title": "Wind Of Change",
    "artist": "Scorpions",
    "starttime": "2024-01-17T11:56:47+01:00",
    "endtime": "2024-01-17T12:00:22+01:00",
    "starttime_seconds": null,
    "endtime_seconds": null,
    "albumarturl": "https://i.scdn.co/image/af75e95f0708055377c64d0c0510af327fee21cd"
    }

    Please don't remove it because for some of the stations that play Swedish music the album art URL is very useful because it is quite likely that I am not able to find it elsewhere.
    I do not do any audio fingerprinting.

    Very few of the stations (broadcasters) that I have this working for provide any documented API.
    From memory, I found your documentation helpful.
    Paul Webster
  • Ok, thanks for clarifying!
    Annika Webbmaster
  • Hi again!

    Peeter reported the metadata was mixed when he listens to Flac, but we couldn't find any problem with the embedded data. Today it struck me that your service is using the API, not the embedded metadata, and that explains this issue!

    Peeter said that this is no big deal for him, but nice if it can be corrected.

    The confusion here is our fault. Our API is very confusing when it comes to our two P2-stations, as we still use older names in the API. The P2 we provide in Flac is today called P2, but the API corresponding to this station uses an older name, "P2 musik". This is the API you need to map to the Flac-stream.

    We also have a version of P2 (not in Flac, though) that today is called P2 språk och musik, and confusingly enough the API corresponding to this station is named P2.
    • P2 -> P2 musik (API)
    • P2 språk och musik -> P2 (API)
    We are sorry for the trouble this can cause, and glad you already had reached out to us and told us you are using the API!
    Annika Webbmaster
  • Thanks for letting me know.

    I am using "the other" API ...
    h t t p s ://sverigesradio.se/playerajax/audiometadata?id=${fetchid}&type=channel
    with ${fetchid} for
    P2 = 2562
    P2 Språk och musik = 163

    However, I have put the Flac stream as belonging to "P2 Språk och musik" ... so, in theory, all I need to do is move that stream to P2.
    I'll try it out later today.
    Paul Webster
  • ah - I see why ... the stream URLs for "P2" all have p2musik in them and for "P2 språk och musik" they all have just p2.
    That is a problem for me because I use a regex on the stream URL to work out which station it is ...
    It will be a bit more complicated than I thought.
    Paul Webster
  • Good luck!
    Annika Webbmaster
  • I have it working - but to be sure that the data feeds that I get really show something different between the 2 stations ... can you tell me when there is a difference between what is on the 2 stations.
    I tried last night but the audio appeared to be the same over an extended period.
    Paul Webster
  • Today the two stations are sending different content from 12.30 to 16.00 Swedish time, when P2 is sending the show P2 Klassiskt, and P2 Språk och musik gives us content in Romani, Finnish and Sami.



    There is also different content from 6 am to 7 am Swedish time, if that suites you better.
    Annika Webbmaster
  • Thanks - I should have checked there.
    I had thought, from the station names, that both stations played the same thing but one had less comments from presenters or perhaps no news inserts.
    Paul Webster

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post syns inte publikt.