PDA

View Full Version : Total track length in Miliseconds


jmoschetti45
24th January 2003, 21:04
When I send winamp A WM_USER # 105 Data 1 I get the current song length in seconds. Is there a way to get it in miliseconds because when I multiply the seconds I end Up with the Seconds + 3 zeros. Winamp would need to directly send back the miliseconds. Is this a problem for winamp to do or can it not do that because of some other problem.

binary hero
28th January 2003, 10:28
i don't think mp3 has milliseconds, it's just seconds.

jmoschetti45
28th January 2003, 18:57
It does because some other media player (BPM Studio) I use displays it And even in frames!

lancegoodwiggle
7th February 2003, 18:11
Could be that the plugin is reading the MP3 file directly. I suppose you could do this too, but offhand I don't know of any API's to read MP3 files directly.

jmoschetti45
8th February 2003, 00:33
I have triyed that but it causes more problems than it fixes. Some how winamp gets the total in miliseconds because somw visualizations show it. I have looked att the vis sdk but that didn't help.

Kaboon
9th February 2003, 15:05
105 If data is 0, returns the position in milliseconds of playback. If data is 1, returns current track length in seconds. Returns -1 if not playing or if an error occurs.

Do I need to say more? Winamp does return length in miliseconds but data needs to be 0 instead of 1. :)

jmoschetti45
9th February 2003, 15:46
Do I need to say more? Winamp does return length in miliseconds but data needs to be 0 instead of 1.

Nice but that dosen't help at all. If you send 0 as data you get the CURRENT Track Position in miliseconds not the TOTAl TIME!

Kaboon
9th February 2003, 15:59
Originally posted by jmoschetti45
Nice but that dosen't help at all. If you send 0 as data you get the CURRENT Track Position in miliseconds not the TOTAl TIME!

Okay, I'm sorry. I misread that. :-S

jmoschetti45
10th February 2003, 00:01
No problem. But I still need to figure out how to do that.:)

underplay
12th June 2004, 03:54
Its easy, just get the max seconds of the track then convert that to milliseconds by adding three 0's at the end, for example this is what i used to createa slider that got the position of the track and adjusted the range accordingly.

Hope it helps :)

int Slide;
int Pos;
CString conv;

Slide = ::SendMessage(Winamp, WM_USER, 1, 105);
conv.Format("%d000", Slide);
Slide = atoi(conv);
m_Slider.SetRange(0, Slide);
Pos = m_Slider.GetPos();
::SendMessage(Winamp, WM_USER, Pos, 106);

shaneh
12th June 2004, 04:16
Converting to a string adding 000 then doing an atoi? :)

How about just *1000? :) pretty simple maths man.

underplay
12th June 2004, 10:18
lol, i figured Slide = (Slide+000) would work but i dont think it did, so i just did it that way.