Copyright © 2001-2019 MultiMedia Soft

PlaySoundEnableLoop method

Previous pageReturn to chapter overviewNext page

Remarks

 

Enables looping of a specific range of sound for the given player.

 

The loop can be disabled at any time in two ways:

 

by calling the PlaySoundDisableLoop method: in this case the sound will continue playing without interruption until reaching the final position of the established range
by calling the PlaySound method: in this case the sound will continue playing without interruption until reaching the end of the sound file

 

By default playback continues till the end of the defined range until the final position is not moved through the PlaySoundMoveFinalPos method.

 

If the player should be already in playback state, the following situations may occur:

 

If the current playback position is located before the position set through the nToPosition parameter, playback will continue without interruption till reaching the position set into the nToPosition parameter where the loop will occur; if you should need an immediate repositioning of the playback position at the beginning of the sound range, use the PlaySoundRangeLoop method.
If the current playback position is located after the position set through the nToPosition parameter, playback is interrupted and restarted from the position set through the nFromPosition parameter.

 

If the player should be in stopped state, a successful call to this method will start playback on the given range and will fire the SoundPlaying event.

 

Each loop completion will cause the control to fire the RangeLoopDone event: the only exception is the completion of the latest loop that will cause the control to fire the SoundDone event.

 

 

Syntax

 

[Visual Basic]

control.PlaySoundEnableLoop (

nPlayer as Integer,

nFromPosition as Long,

nToPosition as Long,

nLoopCount as Long

) as enumErrorCodes


 

[C++]

short control.PlaySoundEnableLoop (

short nPlayer,

long nFromPosition,

long nToPosition,

long nLoopCount

);


 

 

Parameter

Description

 

 

nPlayer

Number representing the zero-based index of the player that will play the sound interval

nFromPosition

Range starting point in the unit specified by the ScaleUnits property. Set this value to 0 for playing from the sound beginning.

nToPosition

Range ending point in the unit specified by the ScaleUnits property. Set this value to -1 for playing till the song end

nLoopCount

Specifies the number of loops over the defined range. Set this value to -1 for setting an infinite loop

 

 

Return value

 

Value

Meaning

 

 

Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The method call was successful