Re: [PHP] Regarding Accesing mp3 with php
At 11:46 AM -0400 6/26/09, Daniel Brown wrote: On Fri, Jun 26, 2009 at 11:42, tedd wrote: Well, at least I had a mother. :-) Mrs. Sperling, Tedd's hurting my feelings Mom... he hurt my feeling first! And his mother doesn't dress him as well as you do me. -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
On Fri, Jun 26, 2009 at 11:42, tedd wrote: > > Well, at least I had a mother. :-) Mrs. Sperling, Tedd's hurting my feelings -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Ask me about our fully-managed servers and proactive management clusters starting at just $200/mo.! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
At 11:22 AM -0400 6/26/09, Daniel Brown wrote: On Fri, Jun 26, 2009 at 11:17, tedd wrote: I stand corrected. Actually, I stand leaning a little to the right. And your mother dresses you funny. ;-P Well, at least I had a mother. :-) tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
On Fri, Jun 26, 2009 at 11:17, tedd wrote: > > I stand corrected. Actually, I stand leaning a little to the right. And your mother dresses you funny. ;-P -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Ask me about our fully-managed servers and proactive management clusters starting at just $200/mo.! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
At 10:49 AM -0400 6/26/09, Daniel Brown wrote: The compression algorithm used for encoding, frequency and quality of the file, and actual noise signature itself would throw this off. For example, a file with seven notes played in a period of 8 seconds will be larger than a file with one note played at the same volume for the same duration. Then take into account the bitrate, if there are ID3 tags or not, if there are compression comments embedded by the encoding software AND At 10:53 AM -0400 6/26/09, Robert Cummings wrote: Dear $_DEITY no. Filesize is barely related to play time. He's going aboutit the correct way, using existing libraries that know how retrieve the information. I would probably try ffplay (part of ffmpeg package): I stand corrected. Actually, I stand leaning a little to the right. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
2009/6/26 Gautam Bhatia : > hello all, > Is there anyway in php by which i can get the total play > time of a mp3 , I found some information while doing the google thing > using some 3rd party plug ins like getID3 but without any luck, Any help > in this case would be helpful. Thank you. > Regards, > > Gautam Bhatia . > > > > I use this and find it very good: http://getid3.sourceforge.net/ Here is some code I'm using on one of my sites. Bit messy - but it works for me :) require_once('../public_html/audio/getid3/getid3.php'); function show_audio($type) { //Set path to audio files if ($type == "rmx") { $path = '/audio/productions/remixes/'; $DirectoryToScan = '../public_html/audio/productions/remixes/'; } elseif ($type == "pro") { $path = '/audio/productions/original/'; $DirectoryToScan = '../public_html/audio/productions/original/'; } $getID3 = new getID3; $dir = opendir($DirectoryToScan); while (($file = readdir($dir)) !== false) { $FullFileName = realpath($DirectoryToScan.'/'.$file); if (is_file($FullFileName)) { set_time_limit(30); $ThisFileInfo = $getID3->analyze($FullFileName); getid3_lib::CopyTagsToComments($ThisFileInfo); echo (!empty($ThisFileInfo['comments_html']['artist']) ? implode('', $ThisFileInfo['comments_html']['artist']) : ' ') . " - "; echo (!empty($ThisFileInfo['comments_html']['title']) ? implode('', $ThisFileInfo['comments_html']['title']) : ' '); echo " (" . (!empty($ThisFileInfo['audio']['bitrate']) ? round($ThisFileInfo['audio']['bitrate'] / 1000).' kbps' : ' ') . ") - "; echo (!empty($ThisFileInfo['playtime_string']) ? $ThisFileInfo['playtime_string'] : ' ') . " - "; echo 'Download'; } } } Then I simply upload audio files to the right directory and I don't have to update the page that lists them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
tedd wrote: At 10:02 AM +0530 6/26/09, Gautam Bhatia wrote: hello all, Is there anyway in php by which i can get the total play time of a mp3 , I found some information while doing the google thing using some 3rd party plug ins like getID3 but without any luck, Any help in this case would be helpful. Thank you. Regards, Gautam Bhatia . Gautam: I think that play time would be proportional to file size, right? If so, then take two files and play them. Note the play times and file sizes of both and work out a algorithm. That would be the way I would try to solve it. Dear $_DEITY no. Filesize is barely related to play time. He's going aboutit the correct way, using existing libraries that know how retrieve the information. I would probably try ffplay (part of ffmpeg package): ffplay -an -stats THE_FILE.mp3 You'll see a line with the duration: Input #0, mp3, from 'THE_FILE.mp3': Duration: 00:03:35.10, start: 0.00, bitrate: 127 kb/s Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
On Fri, Jun 26, 2009 at 10:43, tedd wrote: > > I think that play time would be proportional to file size, right? > > If so, then take two files and play them. Note the play times and file sizes > of both and work out a algorithm. That would be the way I would try to solve > it. The compression algorithm used for encoding, frequency and quality of the file, and actual noise signature itself would throw this off. For example, a file with seven notes played in a period of 8 seconds will be larger than a file with one note played at the same volume for the same duration. Then take into account the bitrate, if there are ID3 tags or not, if there are compression comments embedded by the encoding software -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Ask me about our fully-managed servers and proactive management clusters starting at just $200/mo.! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
At 10:02 AM +0530 6/26/09, Gautam Bhatia wrote: hello all, Is there anyway in php by which i can get the total play time of a mp3 , I found some information while doing the google thing using some 3rd party plug ins like getID3 but without any luck, Any help in this case would be helpful. Thank you. Regards, Gautam Bhatia . Gautam: I think that play time would be proportional to file size, right? If so, then take two files and play them. Note the play times and file sizes of both and work out a algorithm. That would be the way I would try to solve it. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regarding Accesing mp3 with php
On Fri, Jun 26, 2009 at 00:32, Gautam Bhatia wrote: > hello all, > Is there anyway in php by which i can get the total play > time of a mp3 , I found some information while doing the google thing > using some 3rd party plug ins like getID3 but without any luck, Any help > in this case would be helpful. Thank you. > Regards, What issue were you facing when trying to use the (third-party) getID3() function? Also, if you haven't already, check out ffmpeg-php (http://ffmpeg-php.sourceforge.net/). -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Ask me about our fully-managed servers and proactive management clusters starting at just $200/mo.! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regarding Accesing mp3 with php
hello all, Is there anyway in php by which i can get the total play time of a mp3 , I found some information while doing the google thing using some 3rd party plug ins like getID3 but without any luck, Any help in this case would be helpful. Thank you. Regards, Gautam Bhatia .