GetTrackLength
Syntax
GetTrackLength()
Description
Returns the length of the current track in seconds.
Parameters and Remarks
NOTE: GetTrackLength returns the length of the current track in seconds, whilst GetTrackPosition returns the position of the current track in milliseconds, this is a quirk of Winamp's interface.
Examples
JScript
var length_s = winamp.GetTrackLength();
var position_ms = winamp.GetTrackPosition();
var percentage = (position_ms / length_s) / 10;
document.Write("Track is " + perencetage + "% completed");
winamp.SetTrackPosition(length_s * 500);
document.Write("Track position set at 50%");