Copyright © 2005-2019 MultiMedia Soft

Waveform.AnalyzeFullSound method

Previous pageReturn to chapter overviewNext page

Remarks

 

Starts the analysis of the sound loaded inside the given player in order to allow the creation of bitmaps of the sound's waveform.

 

During the analysis phase, the container application will be notified about the current advancement through the CallbackForPlayersEvents delegate which is invoked with the nEvent parameter set to:

 

EV_WAVE_ANALYSIS_START: invoked when the sound's analysis begins.
EV_WAVE_ANALYSIS_PERC: invoked several times during the analysis in order to inform the container application about the percentage of advancement.
EV_WAVE_ANALYSIS_DONE: invoked when the sound's analysis is completed: after catching this event, it will be possible requesting to the control the creation of the waveform's bitmap through a call to the Waveform.BitmapViewSaveToFile or Waveform.BitmapViewSaveToMemory methods. It's important to note that this event will report the exact number of peaks detected inside the loaded sound and the exact duration in milliseconds of each peak. When generating the bitmap for the full sound's waveform, the reported number of peaks will be exactly equal to the width in pixels of the bitmap. In case you should create a view of a given sound's range, you could obtain the number of pixels needed to display the waveform's view through a call to the Waveform.BitmapViewGetWidth method.

 

NOTE: Remember that a call to a method of a certain .NET component should be never performed from within a management function of an event generated by the same .NET component: see the How to synchronize the container application with the control tutorial for further details.

 

Started analysis can be aborted through the Waveform.AnalyzeAbort method.

 

This method doesn't need a previous call to the Waveform.Create method.

 

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.

 

 

Syntax

 

[Visual Basic]

Public Function AnalyzeFullSound (

nPlayerIndex as Int16,

nResolution as enumWaveformResolutions

) as enumErrorCodes


 

[C#]

public enumErrorCodes AnalyzeFullSound (

Int16 nPlayerIndex,

enumWaveformResolutions nResolution

);


 

[C++]

public: enumErrorCodes AnalyzeFullSound (

Int16 nPlayerIndex,

enumWaveformResolutions nResolution

);


 

 

Parameter

Description

 

 

nPlayerIndex

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

nResolution

Number representing the resolution used in order to analyze the sound.

Higher resolutions will allow a higher analysis quality but will require more memory and will generate larger bitmaps.

Supported values are the following:

Mnemonic value

Value

Meaning

WAVEFORM_RES_MINIMUM

0

Minimum resolution, faster calculation time. Each line on the analyzer is the average for 8192 PCM samples. Useful for very long sound files

WAVEFORM_RES_VERY_LOW

1

Very low resolution. Each line on the analyzer is the average for 4096 PCM samples.

WAVEFORM_RES_LOW

2

Low resolution. Each line on the analyzer is the average for 2048 PCM samples.

WAVEFORM_RES_MIDDLE

3

Middle resolution. Each line on the analyzer is the average for 1024 PCM samples.

WAVEFORM_RES_HIGH

4

High resolution. Each line on the analyzer is the average for 512 PCM samples.

WAVEFORM_RES_VERY_HIGH

5

Very high resolution. Each line on the analyzer is the average for 256 PCM samples.

WAVEFORM_RES_MAXIMUM

6

Maximum resolution. Each line on the analyzer is the average for 128 PCM samples. Useful for very small sound files whose duration is under 1 second.

 

 

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.