Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

WAV File Length

How do I determine the amount of time it takes to play a WAV file? 

Is there a correlation betwee file size and length?

TIA

RaZ
Monday, July 12, 2004

1 minute WAVE file equals:

2 (channels) * 16 (bits) * 44100 (samples/s)  * 60 (seconds) =

84672000 bits = 10 584 000 bytes = 10,1 MB

Mats

Mats
Thursday, July 15, 2004

Wonderful.  Thank you very much.

RaZ
Thursday, July 15, 2004

Wonderfully wrong.

You have to read the header of the WAV file. You can't assume that there are 2 channels or that the samples are 16 bits or that the sampling rate is 44K.

In fact you can't even assume the file is PCM as different codecs are supported.

Clutch Cargo
Friday, July 16, 2004

*  Recent Topics

*  Fog Creek Home