Copyright © 2006-2016 MultiMedia Soft

EnableSoundPreloadForPlayback method

Previous pageReturn to chapter overviewNext page

Remarks

 

Prepares the loaded sound for a playback session where the usage of a scrolling waveform may be needed.

 

In order to optimize system resources, when pre-loading is disabled (default situation), the stream to play is only loaded when specifically requested through a call to the RecordedSound.Play or RecordedSound.PlayRange methods and automatically discarded from memory after a call to the RecordedSound.Stop method or when the end of the song is reached. In this situation it's not possible to visually set an initial position through a scrolling waveform until the loaded sound is not in playback. By enabling pre-load through this method, the sound stream is immediately available in memory after a recording or editing session so could set an initial position for playback directly into a scrolling waveform as seen inside the Dictation sample.

 

As a further feature, when pre-load is enabled there is the possibility to distinguish if the sound playback is stopped through the GetPlaybackStatus method..

 

For details about creating a scrolling waveform, refer to the section "Mode 3: Rendering on a graphic Device Context (HDC)" of the How to use the Waveform Analyzer tutorial.

 

 

Syntax

 

[Visual Basic]

control.EnableSoundPreloadForPlayback (

bEnable as enumBoolean

) as enumErrorCodes


 

[C++]

short control.EnableSoundPreloadForPlayback (

short bEnable

);


 

 

Parameter

Description

 

 

bEnable

Boolean value that specifies if the control must enable pre-loading of the sound stream to play.

Supported values are the following:

Value

Meaning

BOOL_FALSE (default)

Disable pre-load

BOOL_TRUE

Enable pre-load

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to see the error code meaning

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.