|
PlaySoundRangeWithRate method |
![]() ![]()
|
Remarks
Plays a specific range of sound that has been previously loaded through one of the many methods having the "Load" prefix like LoadSound or LoadSoundFromMemory,
Respect to the PlaySoundRange method, this method allows playing at lower or higher speeds and to start playback directly from the current position or by using an offset instead of a specific position.
IMPORTANT: This method doesn't have any effect if reversed sound management has not been enabled by a previous call to the Effects.SoundDirectionEnable method or by the WaveformScroller.PlaybackOnScrollEnable method..
A successful call to this method will fire the SoundPlaying event. Once the selected range has been performed completely, the control will fire the SoundDone event.
Syntax
[Visual Basic] Public Function PlaySoundRangeWithRate ( nPlayerIndex as Int16, fFromPosition as Single, fToPosition as Single, bUseFinalPosAsOffset as Boolean, fSampleRateMultiplier as Single ) as enumErrorCodes |
[C#] public enumErrorCodes PlaySoundRangeWithRate ( Int16 nPlayerIndex, float fFromPosition, float fToPosition, bool bUseFinalPosAsOffset, float fSampleRateMultiplier ); |
[C++] public: enumErrorCodes PlaySoundRangeWithRate ( Int16 nPlayerIndex, float fFromPosition, float fToPosition, bool bUseFinalPosAsOffset, float fSampleRateMultiplier ); |
Parameter |
Description |
||||||
|
|
||||||
nPlayer |
Number representing the zero-based index of the player that will play the sound range |
||||||
fFromPosition |
Range starting point in the unit specified by the ScaleUnits property. Set this value to -1 for starting playback from the current position |
||||||
fToPosition |
Range ending point in the unit specified by the ScaleUnits property. Set this value to -1 for playing till the song end |
||||||
bUseFinalPosAsOffset |
Flag that specifies if the value set inside the fToPosition parameter should be considered as an offset respect to the start position or as a specific position. Supported values are the following:
|
||||||
fSampleRateMultiplier |
The sample rate multiplier applied to the sound stream. This value can range from 0.1 (meaning that the sound stream will be played at 10% of its normal speed, 10 times slower) up to 30.0 (meaning that the sound stream will be played at 3000% of its normal speed, 30 times faster). Values outside of the mentioned range will be automatically capped to the nearest valid value. A value of 1.0 will play the sound stream at its original sample rate. |
Return value
Value |
Meaning |
|
|
Negative value |
An error occurred (see the LastError property for further error details) |
enumErrorCodes.NOERROR (0) |
The method call was successful |