Copyright © 2001-2018 MultiMedia Soft

Waveform.PeaksBufferLengthGet method

Previous pageReturn to chapter overviewNext page



Given a range in milliseconds, obtains the size in bytes required by the buffer in order to store related waveform peaks. Once the size is known, you may allocate a buffer to pass to the Waveform.PeaksBufferGet method.


Before calling this method it's mandatory performing a previous sound's analysis through a call to the Waveform.AnalyzeFullSound method and waiting its completion through the WaveAnalysisDone event.


For further details about generating a waveform bitmap of the loaded sound, before starting its playback, refer to the How to obtain the sound's waveform tutorial.





[Visual Basic]

control.Waveform.PeaksBufferLengthGet (

nPlayer as Integer,

nStartPos as Long,

nEndPos as Long,

nBufferLength as Long

) as enumErrorCodes



short control.Waveform.PeaksBufferLengthGet (

short nPlayer,

long nStartPos,

long nEndPos,

long nBufferLength









Number representing the zero-based index of the player that will use the Waveform


Number representing the start position, expressed in milliseconds, where we want to get waveform's peaks.

The value 0 represents the sound's beginning.


Number representing the end position, expressed in milliseconds, where we want to get waveform's peaks.

The value -1 represents the sound's end.


Reference that, on return from the method call, will contain the size in bytes needed for storing requested peaks into a buffer.



Return value






Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The method call was successful