Search code examples
javascriptphpmp3id3webradio

Get ID3 tag from MP3 Streaming


I encounter difficulties in recovering informations (ID3 tag) from an MP3 stream. I want this informations for display the albumArt and the title of the current song on the homepage of the radiomed's website.

Update


With PHP , I worked with ID3 library for PHP, but this library was not up to date since 2004 and with Javascript , I worked with TagLib, MusicMetadata and id3js . The results were errors messages (js) and string (0) with a var_dump($getID3) // this return the object obtain with the catched info from the stream .

The result should be, title and artist of the current on air song.

I tried with php & js but I failed.


Solution

  • This example can help you https://gist.github.com/fracasula/5781710

    But it won t read the stream conitnuously, it will just fetch first buffer and try it. It may or may not returns the current track name, it depends.

    It needs to be improved, i guess, to read stream in continue and detect each buffer for track data. Thus you could show it wherever needed.