Copyright © 2013-2017 MultiMedia Soft

AnalyzeSoundFromFile method

Previous pageReturn to chapter overviewNext page



Starts the analysis of the given media file. Supported media file formats can be divided in three categories:


Audio formats supported natively, meaning that the decoding is performed directly inside the internal code of the component:


- Microsoft WAV

- Free Lossless Audio Codec - FLAC

- OGG/Vorbis

- Sun / DEC / NeXT AU / SND

- Apple AIFF / SGI / AIFC

- Apple CAF

- Commodore Amiga IFF / SVX

- Creative VOC

- Fasttracker 2 XI

- GNU Octave 2.0 MAT4

- GNU Octave 2.1 MAT5

- HMM Tool Kit - HTK


- Paris Audio File - PAF

- Portable Voice Format - PVF

- Sound Designer II - SD2

- Soundforge W64

- Sphere Nist WAV


for a full list of encodings supported by the single audio formats available on the table above see the Appendix A - Encodings for audio formats supported natively section.


Audio and video formats supported by Microsoft Media Foundation (only on Windows Vista and higher versions); for a full list of supported media formats, please, see the related Microsoft Media Foundation page on the MSDN web site.


Audio and video formats supported by Microsoft DirectShow: depending upon the format of the media file, there could be the need to install specific DirectShow codecs.


For analyzing files in RAW format use the AnalyzeSoundFromFileRaw method.


Data resulting from an analysis session can be discarded from memory using the FreeMemory method.


By default the full audio file is analyzed: in case you should only need to analyze a specific portion of the audio file, you could limit the analyzed range through the AnalyzeSoundFromFileRangeSet method.


In case of media files whose format is not supported natively, the call to this method will try extracting the audio track through Microsoft Media Foundation or through Microsoft DirectShow: in case of successful opening of the media file, during the audio extraction the container application will be notified about the current advancement through the AudioExtractFromMediaFileStart event followed by a number of AudioExtractFromMediaFilePerc events and finally by the AudioExtractFromMediaFileDone event.


After the audio extraction or when dealing with natively supported formats, the waveform analysis phase starts automatically and the container application is notified about the current advancement through the WaveAnalysisStart event followed by a number of WaveAnalysisPerc events and finally by the WaveAnalysisDone event.


When dealing with audio or video formats not supported natively, in case you should be willing to perform waveform analysis automatically during the extraction, you may invoke the EnableAutoWaveAnalysisOnLoad method.





[Visual Basic]

Public Function AnalyzeSoundFromFile (

strPathname as String

) as enumWanErrorCodes



public enumWanErrorCodes AnalyzeSoundFromFile (

string strPathname




public: enumWanErrorCodes AnalyzeSoundFromFile (

string strPathname










String representing the absolute pathname of the input file.



Return value






Negative value

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

enumWanErrorCodes.ERR_WAN_NOERROR (0)

The method call was successful.