Copyright © 2001-2018 MultiMedia Soft

SoundDurationGet method

Previous pageReturn to chapter overviewNext page

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 loaded sound duration can be obtained through the SoundDurationStringGet method.

 

 

Syntax

 

[Visual Basic]

control.SoundDurationGet (

nPlayer as Integer,

fDuration as Double,

bKeepCountOfRateChange as enumBoolean

) as enumErrorCodes


 

[C++]

short control.SoundDurationGet (

short nPlayer,

double *fDuration,

short bKeepCountOfRateChange

);


 

 

Parameter

Description

 

 

nPlayer

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

fDuration

Reference that, on return from the method call, will contain the duration of the loaded sound expressed in milliseconds.

bKeepCountOfRateChange

Boolean flag that specifies if the returned position must keep count of eventual playback rate changes set through previous calls to the Effects.PlaybackTempoSet or Effects.PlaybackRateSet methods.

Supported values are the following:

Mnemonic constant

Value

Meaning

BOOL_FALSE

0

Don't keep count of playback rate changes

BOOL_TRUE

1

Keep count of playback rate changes

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The call was successful.