Read length and bitrate mp3

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vttv
Forum Newbie
Posts: 2
Joined: Wed Aug 18, 2010 9:49 pm

Read length and bitrate mp3

Post by vttv »

i'm new PHP.
i want read length and bitrate file mp3(http://..../123.mp3) to calculator total time but i don't k.please help me.thanks.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Read length and bitrate mp3

Post by requinix »

There's likely a script out on the internet that can do this already. Google for it.

If you want to do it yourself,
- For the length you have to divide the number of samples by the sample rate.
- For the bitrate, it varies: CBRs are easy but with VBRs you'd have to check each frame and average out the rates.
How much do you know about the MP3 format?
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: Read length and bitrate mp3

Post by cpetercarter »

getid3() will extract the information you need and much more.
vttv
Forum Newbie
Posts: 2
Joined: Wed Aug 18, 2010 9:49 pm

Re: Read length and bitrate mp3

Post by vttv »

getID3()
with file local ex: C:/1.mp3 so it work, but it don't work with file on server( ex: htt://../1.mp3 )
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: Read length and bitrate mp3

Post by cpetercarter »

When you try to read information about mp3 files on your remote server, is getid3() also installed on the server, or are you trying to access the files from your local machine?

What are the permissions in the folder where the mp3 files are situated.
Post Reply