#1 2010-01-25 18:39

Cld
Member
Registered: 2006-12-10
Posts: 7

Strange Audio_Duration Meta Tags behavior

Hello Denis,
I have encountered a strange behavior of the various Audio_Duration Meta Tags: I have some .wma files, and while both Windows Explorer, WinAmp, WMP, Real Player, VLC, etc.  say the same thing, the renamer Meta Tag says a different value.
For example, I have a .wma file in which the Explorer (and the other stuff) says that it lasts for 5.38.54 (5 hours, 38 minutes and 54 seconds). This means 338.54 minutes or 20,334 seconds; the renamer Meta Tag says respectively 345.29 for Audio_Duration, 345 for Audio_DurationMins and 20729 for AudioDurationSecs. This seems to apply to every .wma file (.mp3 files, for instance, work fine).

Do you have any idea for this discrepancy?

Many thanks for your work.
Claudio.

Offline

#2 2010-01-26 00:38

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Re: Strange Audio_Duration Meta Tags behavior

Hi Claudio,

Duration on WMA files is calculated based on the Max Bit Rate. For constant bit rates the duration should be exact, but for variable bit rates the duration will be an estimate. Sophisticated players like WinAmp and WMP will probably have better methods for estimating the duration, or maybe they scan the whole file for that.

Offline

#3 2010-01-26 10:25

Cld
Member
Registered: 2006-12-10
Posts: 7

Re: Strange Audio_Duration Meta Tags behavior

Hello again,
thank you for your explanation. In effect this explain where your values comes from. My Max Bit Rate is 32,024 bit, and my File Size is 82,978,280 bytes. If you divide size by rate you obtain 20,729, your value smile Note that the file has a constant bitrate.

Anyway, I've seen that inside the file there's an header section, described in the official microsoft document located at http://go.microsoft.com/fwlink/?LinkId=31334 (from page http://www.microsoft.com/windows/window … pec.aspx), in which at offset +0x478 there's the hex value 50230F582F000000, which reversed and converted gives 203,340,850,000, which in 100-nanoseconds unit takes to the 20,334.085 seconds that every software (and Windows itself) gives as its audio duration.

So, I'm just wondering if you could take this value for duration, exactly as I think you do to obtain the bitrate, instead to calculate it from file size and bitrate (which leads to a wrong value sad). Could this makes sense?

Many thanks again,
Claudio.

Last edited by Cld (2010-01-28 16:59)

Offline

Board footer

Powered by FluxBB