123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|30|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Off Topic -> Music File lengths

Wed, 15 Oct 2008, 16:33
dna

Does anyone know the equation for calculating the playing time of music files given the file size?


-=-=-
DNA
Wed, 15 Oct 2008, 16:53
blanko1324
I really don't think you can, given all types and methods of compression and bitrates and such.

-=-=-
My Twitter
Wed, 15 Oct 2008, 17:05
mindstorm8191
Yeah, bitrate would have alot to do with the filesize-to-song length ratio. Plus if I'm not mistaken, mp3 files will divide different parts of a song out into different pieces, much like different insturments in a band. A complex song would be larger but shorter than a simple song, considering this.

-=-=-
Vesuvius web game
Wed, 15 Oct 2008, 21:44
Stealth
[Post Retracted, Inaccurate]
Thu, 16 Oct 2008, 19:18
dna
There has to be a way.

I see many programs created that use the bit rate and whatever else to calculate the play time.

-=-=-
DNA
Thu, 16 Oct 2008, 21:25
Stealth
I did a bit of research.


The length of the file is this formula:

size_in_bytes / bitrate = length_in_seconds


But note, that doesn't work with a variable bit rate.

-=-=-
Quit posting and try Google.
Tue, 21 Oct 2008, 10:58
Paul
The file can also contain tags with just about any information in them. The album image can for example be stored in an mp3 IDv3 tag.
Tue, 21 Oct 2008, 18:44
dna

Thank Stealth.

I tried that and it did not work for the .wav file that I created.

Maybe the method Paul wrote about will work. The file lengths are in some headers. I'll have to figure which bits are the least and most significant.


-=-=-
DNA