Copyright © 2006-2019 MultiMedia Soft

WaveformAnalyzer.SnapshotViewSaveToMemory method

Previous pageReturn to chapter overviewNext page

Remarks

 

Creates a memory bitmap view (in form of memory bitmap referenced by a HBITMAP) of the analysed sound waveform: the view can represent the full sound's waveform or portions of it.

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

 

For details about generating a waveform bitmap of the recorded sound and about the use of the Waveform Analyzer refer to the How to use the Waveform Analyzer section.

For further details about methods of the Waveform Analyzer refer to the WaveformAnalyzer object section.

 

 

Syntax

 

[Visual Basic]

control.WaveformAnalyzer.SnapshotViewSaveToMemory (

nMode as enumWaveSnapshotViewMode,

nStartPos as integer,

nEndPos as integer,

nBitmapWidth as integer,

nBitmapHeight as integer,

nChannel as enumWaveformChannels

) as long


 

[C++]

long control.WaveformAnalyzer.SnapshotViewSaveToMemory (

short nMode,

long nStartPos,

long nEndPos,

long nBitmapWidth,

long nBitmapHeight,

short nChannel

);


 

 

Parameter

Description

 

 

nMode

Snapshot view mode.

Supported values are the following:

Mnemonic value

Value

Meaning

WAVE_SNAPSHOT_MODE_WAVEFORM

0

Snapshot of the waveform

WAVE_SNAPSHOT_MODE_SPECTRAL

1

Snapshot of the spectral view

WAVE_SNAPSHOT_MODE_WAVEFORM_ABS

2

Snapshot of the waveform with absolute values

nStartPos

Number representing the sound's position, expressed in milliseconds, where the waveform visualization begins.

The value 0 represents the sound's beginning.

nEndPos

Number representing the sound's position, expressed in milliseconds, where the waveform visualization ends.

The value -1 represents the sound's end.

nBitmapWidth

Number representing the generated bitmap width, expressed in pixels. A value of -1 indicates no width constraints: in this case the control will generate a bitmap large enough in order to contain the full sound's waveform.

nBitmapHeight

Number representing the generated bitmap height, expressed in pixels.

nChannel

Audio channel to render.

Supported values are the following:

Mnemonic value

Value

Meaning

WAVEFORM_CHAN_ALL

-2

The snapshot contains sound data for all channels separated

WAVEFORM_CHAN_MIXED

-1

The snapshot contains sound data for all channels mixed together

WAVEFORM_CHAN_0

0

The snapshot contains sound data for channel 0 or left channel for stereo

WAVEFORM_CHAN_1

1

The snapshot contains sound data for channel 1 or right channel for stereo

WAVEFORM_CHAN_2

2

The snapshot contains sound data for channel 2

WAVEFORM_CHAN_3

3

The snapshot contains sound data for channel 3

WAVEFORM_CHAN_4

4

The snapshot contains sound data for channel 4

WAVEFORM_CHAN_5

5

The snapshot contains sound data for channel 5

WAVEFORM_CHAN_6

6

The snapshot contains sound data for channel 6

WAVEFORM_CHAN_7

7

The snapshot contains sound data for channel 7

 

 

Return value

 

Value

Meaning

 

 

0

An error occurred (check the LastError property for error details)

Value is not 0

The method call was successful and the returned value represents the handle (HBITMAP) of the waveform's bitmap stored in memory. When the returned HBITMAP is no more needed or before exiting the container application, in order to avoid memory leaks this handle should be deleted using the DeleteObject Windows API.