Calculating the duration of WAV files