Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Displaying a Short description (http://www.programmingforums.org/showthread.php?t=10737)

billpull Jul 15th, 2006 11:54 PM

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.

tempest Jul 16th, 2006 12:49 AM

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...

titaniumdecoy Jul 16th, 2006 12:52 AM

Are the files on your server? If so, I'm sure there's some way to extract that information from them.

billpull Jul 16th, 2006 1:32 AM

yea they, are thats what i am asking how i would do that.

Jimbo Jul 16th, 2006 2:00 AM

This may be of some use, if you're using the ID3 tags...

titaniumdecoy Jul 16th, 2006 2:36 AM

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.

Jimbo Jul 16th, 2006 3:02 AM

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...

billpull Jul 16th, 2006 10:34 AM

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"?>
<songlist>
 <title>Song List</title>
 <description>a list of songs and information</description>
 <shpadoinkle.mp3>
  <title>Shpadoinkle</title>
  <link>/jacobsite/Shpadoingkle.mp3</link>
  <description>
  My rendition of a song from Trey Parker’s first movie “Cannibal! The
  Musical.”  I will be recording more from this spectacular movie and
  making a CD (which will be called “Jake Sherman Plays Trey Parker.”)
  Find out more about “Cannibal! The Musical” here:
  http://www.cannibalthemusical.net/index.shtml
  </description>
 </shpadoinkle.mp3>
 <danicalifornia.mp3>
  <title>Dani California</title>
  <link>/jacobsite/Dani_California.mp3</link>
  <description>
  A Song by the Red Hot Chilli Peppers on their new cd "Stadium Arcadium".
  </description>
 </danicalifornia.mp3>
</songlist>



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