Copyright © 2006-2026 MultiMedia Soft

RecordedSound.PlayRangeWithRate method

Previous pageReturn to chapter overviewNext page

Remarks

 

Plays the given range inside the last recorded sound: if sound data resulting from a recording session has been stored in memory, this method will start a playback session using recorded sound data in memory; if sound data have been stored into a disk file, this method will load and will automatically play the file.

 

Respect to the RecordedSound.PlayRange 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 RecordedSound.SoundDirectionEnable method or by the WaveformScroller.PlaybackOnScrollEnable method..

 

A successful call to this method will fire the SoundPlaybackPlaying event. Once the playback session has been performed completely, the control will fire the SoundPlaybackDone event.

 

For further details about recorded sound methods refer to the RecordedSound class section.

For further details see the How to perform a recording session section.

 

 

Syntax

 

[Visual Basic]

Public Function PlayRangeWithRate (

fFromPosition as Single,

fToPosition as Single,

bUseFinalPosAsOffset as Boolean,

fSampleRateMultiplier as Single

) as enumErrorCodes


 

[C#]

public enumErrorCodes PlayRangeWithRate (

float fFromPosition,

float fToPosition,

bool bUseFinalPosAsOffset,

float fSampleRateMultiplier

);


 

[C++]

public: enumErrorCodes PlayRangeWithRate (

float fFromPosition,

float fToPosition,

bool bUseFinalPosAsOffset,

float fSampleRateMultiplier

);


 

 

 

Parameter

Description

 

 

fFromPosition

Start position, expressed in milliseconds, of the sound range to play. Set this value to -1 for starting playback from the current position.

fToPosition

End position, expressed in milliseconds, of the sound range to play. 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:

Mnemonic Value

Meaning

false

The fToPosition parameter represents a specific position within the loaded sound

true

The fToPosition parameter represents an offset respect to the start position specified inside the fFromPosition parameter

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