HTML5 audio.duration calculates the wrong duration because it doesn't exclude the stuff before the header like id3-tag with artwork.
If you add artwork to your file this can be multiple seconds.
I read about the Content-Length HTTP response header but I write a script where you drag'n'drop local files so that won't help much.
Can I calculate the duration myself without HTML5? If HTML5 can calculate it from the bytes and frames (?) it should be possible to do it better.