Hi guys!!
can anyone please tell me how to convert a audio file size to length.
Say I have a file(abc.mpeg) which is 4.6 MB in size & its length is 4.58 minutes.
So is there any function in php by which i can get the length from the size of that file??
maybe the sound is so silly but please help me!!
Regards
convert size to length
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Size rarely has much to do with length because of the various quality levels one can choose when encoding a file. It is best to read the file's data to determine actual length. If you want to throw out an estimate based on an assumption that it is X encoding, then sure. There is no function built into PHP that will do it in a single step for you. You will need to perform that math.
If you want it to be accurate, look into ffmpeg.
If you want it to be accurate, look into ffmpeg.
convert size to length
actually I need to get the length or play-time of each song.
I kept the file into a foleder & there name is in the database.
Can anyone know any way to get the length of music file???
Please tell me.
I kept the file into a foleder & there name is in the database.
Can anyone know any way to get the length of music file???
Please tell me.