Soyez le premier à donner votre avis sur cette source.
Snippet vu 15 661 fois - Téléchargée 30 fois
<? function ReadTag($path) { $genre_array = array("Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge", "Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B", "Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska", "Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient", "Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical", "Instrumental","Acid","House","Game","Sound Clip","Gospel", "Noise","AlternRock","Bass","Soul","Punk","Space","Meditative", "Instrumental Pop","Instrumental Rock","Ethnic","Gothic", "Darkwave","Techno-Industrial","Electronic","Pop-Folk", "Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta", "Top 40","Christian Rap","Pop/Funk","Jungle","Native American", "Cabaret","New Wave","Psychadelic","Rave","Showtunes","Trailer", "Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro", "Musical","Rock & Roll","Hard Rock","Folk","Folk-Rock", "National Folk","Swing","Fast Fusion","Bebob","Latin","Revival", "Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock", "Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band", "Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson", "Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus", "Porn Groove","Satire","Slow Jam","Club","Tango","Samba", "Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle", "Duet","Punk Rock","Drum Solo","Acapella","Euro-House","Dance Hall"); $file=fopen($path, "rb"); if($file) { fseek($file, 0, SEEK_END); fseek($file, -128, SEEK_CUR); $tag=fread($file, 128); fclose($file); } else { return 0; } if ($tag[0]=='T' && $tag[1]=='A' && $tag[2]=='G') { $title=substr($tag,3,30); $artist=substr($tag,33,30); $album=substr($tag,63,30); $year=substr($tag,93,4); $comment=substr($tag,97,30); $type=ord(substr($tag,127,1)); if($type >= 0 && $type <= 125) $genre = $genre_array[$type]; else $genre = "none"; if (ord($comment[28]) == 0 && ord($comment[29]) != 0) { $track = ord($comment[29]); $comment[29] = "\0"; } else { $track = 0; } return sprintf("%s-%s-%s-%s-%s-%s-%s",$title, $artist, $album, $year, $comment, $genre, $track); } else { return 0; } } /*Exemple d'utilisation*/ $path = "Test.mp3"; $tag = ReadTag($path); if($path == 0) print("Lecture du tag impossible"); else { list($title, $artist, $album, $year, $comment, $genre, $track) = explode ("-", $tag); print($title); print("<br>"); print($artist); print("<br>"); print($album); print("<br>"); print($year); print("<br>"); print($comment); print("<br>"); print($genre); print("<br>"); print($track); print("<br>"); } ?>
10 mars 2003 à 08:52
12 mars 2003 à 05:01
Ce commentaire à été pensé, écrit et posté par NitRic
NitRic© Toute reproduction même partielle est interdite même avec accord écrit de l'auteur
Beubye && @++;
=P
12 mars 2003 à 12:45
16 mai 2003 à 22:30
if ( fseek( $file, -128L, SEEK_END ) != 0)
{
print ("Erreur en positionnant le pointeur de fichier");
return 0;
}
Bye
24 août 2003 à 20:34
if($path == 0) print("Lecture du tag impossible"); else...
c'est pas $path qui doit être utilisé, un type chaîne, mais $tag
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.