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 following events: WaveAnalysisStart, WaveAnalysisPerc and WaveAnalysisDone: after receiving the WaveAnalysisDone event, it will be possible calculating the width in pixels of a bitmap view through the Waveform.BitmapViewGetWidth method and creating bitmaps of the waveform through the Waveform.BitmapViewSaveToFile and Waveform.BitmapViewSaveToMemory methods.
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 through events 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
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.
|
|