Forums

Full Version: Bad TALDSAudioPlayer->DurationTime return value
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i got a problem. When I use fuction AudioPlayer->DurationTime, with some songs - +-50% I got bad return value. Problem is, that one file (3:57min) returns correct value, but other one (both are MP3) returns wrong value... Does somebody have any idea where can be problem? Thanks so much for tips.

Code:
__int64 Time;
TALDSAudioPlayer->FileName = "FILE.MP3";
TALDSAudioPlayer->Open();
Time = TALDSAudioPlayer->DurationTime();
TALDSAudioPlayer->Close();

Dave

Hi! How do you check/verify the time you get?

Regards,
Dave
What do you mean? I dont know what are you asking about?

Dave

Well you get the time in 100 nanoseconds, and because i couldn't recreate this i wondered how you calculate the time to minutes and seconds. Maybe that's the problem instead of the component.

Dave
Yeah... I get it... I just divided by 10E7 -> On seconds... But its not point of problem... I was trying many things and is not in convert-to-min-sec function... When i tried to ShowMessage() it i get bad value (3mins - returned +- 180sec, then try other 3min song again ShowMessage() it and returned totally bad value - +- 500sec) ... its simply returning bad value. Have no idea where is problem... Sometimes works perfectly, sometimes totally wrong.
So do you have any idea why this fucntion returns bad value? Open file, call DurationTime(), Close file()... sometimes work sometimes not, I will be really grateful for any tips.

Dave

Probably a DS issue but without further details i can't, haven't seen it fail yet. Perhaps PM/mail me the mp3 (or a part of it) or mail it to mr.Mitov.

Regards,
Dave
Reference URL's