Copyright © 2005-2011 MultiMedia Soft

GetSoundOriginalDuration method

Previous pageReturn to chapter overviewNext page

Remarks

 

Gets the duration of the song currently loaded.

 

Differently from the GetSoundDuration method, this method doesn't keep count of eventual tempo and/or playback rate changes so the reported duration will be the original one.

 

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 GetFormattedSoundOriginalDuration method.

 

 

Syntax

 

[Visual Basic]

Public Function GetSoundOriginalDuration (

nPlayerIndex as Int16

) as Int32


 

[C#]

public Int32 GetSoundOriginalDuration (

Int16 nPlayerIndex

);


 

[C++]

public: Int32 GetSoundOriginalDuration (

Int16 nPlayerIndex

);


 

 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the player whose information must be retrieved

 

 

Return value

 

Value

Meaning

 

 

Value > 0

The song duration in milliseconds

Negative value

An error occurred (see the LastError property for further error details)