Wrong audio file duration issue.

NJDubois

Well-known member
Joined
May 15, 2008
Messages
84
Programming Experience
Beginner
Bare with me! I ask here as I am unsure where else to ask!

I have a vb.net app that converts downloaded audio files from AU to MP3 using ffmpeg. Once the file is converted it automatically starts playing the file using WMPLib. First it sets a trackbar to match the audio files duration, and changes the text of a label to the total duration of the file, than starts playback.

What's weird is that the audio file duration, and the duration read don't match.

For example, the file I am testing with has a duration of 3:10 but is read as 2:45. When the track bar reaches the > 2:45 mark I get an error as the audio file wants to keep playing but I am outside the bounds of the track bars max.

It gets weirder! If I open the file in windows media player, it says 2:45. If I open it in VLC player, the duration increase as the file plays until it reaches the 3:10 mark. In winamp, the file loads with a duration of 3:10 right off the bat.

I have not ruled FFMpeg out and am posting a similar question on their support forum as soon as I am approved. Admin approval is just... I don't know... lame? (They had 2 form elements to prove I was human on the register page too?) Because I do get correct values in other audio programs I'm hoping it is an issue with WMPLib.

Is this a 32 bit vs 64 bit issue? Is this even a known issue at all? Anyone else get this? I google the snot out of it and I get a lot of weird results, and nothing that points me to the right direction.

Any help, suggestions or critiques are greatly appreciated!

thanks a ton,
Nick

[EDIT]
This application was working before. I had recently gone in and changed the way it saves a file name. It includes the persons name in the filename and sometimes there is an apostrophe that I .replace to a "-" I believe that since then we had the audio duration issue, and that maybe a different version of WMPLib was compiled into the app?
 
Last edited:
Update:

I tried using SoX to convert the file and windows media reads the correct duration. Must be ffmpeg.
 
Back
Top