![]() |
Displaying a Short description
Im making a sortof playlist type thing for a client and I want to a display a short description of the song is there anyway PHP can gather that information from the mp3 or from a playlist.
|
You can send a packet to google requesting the first page listing when searching for lyrics for a particular song via the ID3 information in the mp3 file or the filename it self...
|
Are the files on your server? If so, I'm sure there's some way to extract that information from them.
|
yea they, are thats what i am asking how i would do that.
|
This may be of some use, if you're using the ID3 tags...
|
This might also be helpful; it explains how to extract such information from MP3 files in Python, but I'm sure the concepts are transferable to PHP.
|
I think that PHP's id3_get_tag would still be easiest, especially as it's not restricted to the ID3v1 tags as the Python script is written for (I don't know how much the tags changed between versions). Of course, you will have to install the id3 package into your PHP installation, which may be a drawback...
|
yea that does seem like a good way but it seems like i could just get the info from xml and not have to configure any extra packages which would be hard for my client to do anyways.
here is my code so far [PHP]<?php //select which song from url $song = $_GET['song']; //quicktime player that gets the source of the song from the url echo '<embed qtsrc='.$song.' height"256" width="320" src='.$song.' type="image/x-quicktime" pluginspage="[http://www.apple.com/quicktime/download/]" autoplay="true">'; /*Display current song and short description*/ //point variable to songlist.xml $songlist = "songlist.xml"; //connect to songlist.xml $songxml = simplexml_load_file($songlist); //set simple if statement that if a song is selected display song information if ( $song != NULL){ echo '<p id="soinginfo">Right now you are listing to '.$song.':<br/>'.$songxml->songlist->$song->description.'</p>'; } /*End display info settings*/ ?>[/PHP] and the xml file as an example :
<?xml version="1.0" encoding="iso-8859-1"?> |
| All times are GMT -5. The time now is 1:47 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC