0

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
outstore
  • 175
  • 2
  • 13
  • What library did you use ? What is the result, what should the result be ? –  May 10 '15 at 10:07
  • 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 . – outstore May 10 '15 at 10:30
  • The result should be, title and artist of the current on air song. – outstore May 10 '15 at 10:31
  • 1
    You should edit your question and add some code sample which gives you trouble. – Alexandru Guzinschi May 10 '15 at 10:40
  • Added update from comment into question for better understanding – Pranav Singh May 13 '15 at 04:54

2 Answers2

1

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.

0

You could try to use PECL extension if you want to fetch id3 directly from mp3

pecl install id3-0.2

And than use a id3_get_tag function:

<?php
   $tag = id3_get_tag( "path/to/example.mp3" );
   print_r($tag);
?>

But instead doing this, i would search documentation of your streaming software, probably there is some api to fetch stream data (json, xml, plain text)

r4ven
  • 303
  • 2
  • 11