You are here: Re: Length of MP3? « PHP Programming Language « IT news, forums, messages
Re: Length of MP3?

Posted by Toby A Inkster on 03/02/07 18:41

Lawrence wrote:

> Could you recommend an "easy to use" PHP module that will tell me the
> length of an uploaded mp3 file?

If you can install a command line tool onto your server, then grab and
install mp3info:

ftp://metalab.unc.edu/pub/linux/apps/sound/mp3-utils/mp3info

and then call it like this:

$s = `/path/to/mp3info -p '%S' /path/to/audio-file.mp3`;

This will set $s to the length of the file, in seconds.

You can also substitute '%S' for '%r' (bit rate), '%o' (stereo-ness),
'%Q' (sampling rate) and various other things.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация