Parse the wave file header, then simply
duration = subchunk2Zize / byteRate
would work.
see: WAVE PCM soundfile format
Home