This is a VB6 question.
How does Windows Media Player compute duration? Is it possible to detect corrupt media files and do not compute duration on these? I sometimes get duration = 0, why does that happen?
Thanks :)
This is a VB6 question.
How does Windows Media Player compute duration? Is it possible to detect corrupt media files and do not compute duration on these? I sometimes get duration = 0, why does that happen?
Thanks :)
size_in_bytes / bitrate = length_in_seconds.
for wmp you can use
lblPlayTime.Caption = wmp.CurrentPosition \ 60 & ":" & Format(Int(wmp.CurrentPosition Mod 60), "00") & " / " & wmp.SelectionEnd \ 60 & ":" & Format(Int(wmp.SelectionEnd Mod 60), "00")
There is some great information here http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx
Variable bitrates can sometimes cause the duration to be wonky in WMP (and others). I wouldn't count on it to be a hard and fast rule for corrupt files.