Copyright © 2001-2008 MultiMedia Soft 
Return to Table of contents  
 
GetSoundDuration method 
 
Remarks 
 
Gets the duration of the song currently loaded.  
 
Due to the format of an MPEG Audio bitstream, it is not possible to know the type and duration of a MP3 file by just looking at a header. Some guesses can be made, but for a precise measurement of the contents of an MPEG Audio file, the entire file has to be scanned: this method performs only a foresight of the sound duration.  
 
A formatted string of the song duration can be retrieved using the GetFormattedSoundDuration method.  
 
 
Syntax 
 
[Visual Basic] 
control.GetSoundDuration
nPlayer as Integer 
) as Long
 
[C++] 
long control.GetSoundDuration
short nPlayer 
);
 
 
Parameter
Description
 
 
nPlayer
Number representing the zero-based index of the player whose information must be retrieved
 
 
Return value 
 
Value
Meaning
 
 
Value > 0
The song duration expressed in milliseconds
Negative value
An error occurred (see the LastError property for further error details)
 
 
 
 
 
 
 
Copyright © 2001-2008 MultiMedia Soft 
Return to Table of contents