Copyright © 2008-2023 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 PlaySound or PlaySoundRange methods and automatically discarded from memory after a call to the StopSound 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 SoundEditor 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]

Public Function EnableSoundPreloadForPlayback (

bEnable as Boolean

) as enumErrorCodes


 

[C#]

public enumErrorCodes EnableSoundPreloadForPlayback (

bool bEnable

);


 

[C++]

public: enumErrorCodes EnableSoundPreloadForPlayback (

bool 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

false (default)

Disable pre-load

true

Enable pre-load

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred. Check the LastError property value in order to see the last error.

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.