VideoPlayer.AudioTrackExtract method |
|
Remarks
Starts the extraction of the audio track stored inside the media file into a destination memory buffer or into a temporary file. The format of the extracted sound is WAV PCM having the same frequency and number of channels of the original audio stream.
Once extracted, the audio track can be used to perform waveform analysis, BPM (Beats per minute) detection and sound silence detection.
If the size of the extracted track is less than 2 GBytes, the track is stored in uncompressed WAV PCM format; for sizes higher than 2 GBytes the W64 format is automatically used.
The call to this method will generate an AudioExtractFromVideoStart event followed by a number of AudioExtractFromVideoPerc events (that will inform about extraction advancement) and, finally, a AudioExtractFromVideoDone event.
Audio extraction can be aborted at any time through the VideoPlayer.AudioTrackExtractAbort method.
Once the extracted track is no more needed, you can free the memory buffer or delete the temporary file by using the VideoPlayer.AudioTrackFree method.
For further details about the use of the embedded video player see the VideoPlayer class section.
For details about video clips rendering refer to the How to play video files through DirectShow tutorial.
Syntax
[Visual Basic] Public Function AudioTrackExtract ( nPlayerIndex as Int16, bStoreInMemory as Boolean ) as enumErrorCodes |
[C#] public enumErrorCodes AudioTrackExtract ( Int16 nPlayerIndex, bool bStoreInMemory ); |
[C++] public: enumErrorCodes AudioTrackExtract ( Int16 nPlayerIndex, bool bStoreInMemory ); |
Parameter |
Description |
||||||
|
|
||||||
nPlayerIndex |
Number representing the zero-based index of the player that will use the video player. |
||||||
bStoreInMemory |
Boolean value that specifies if the audio track needs to be stored in memory or inside a temporary file. Supported values are the following:
|
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. |