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.
During the audio extracting session, the container application will be notified about the exporting advancement through the CallbackForPlayersEvents delegate which is invoked with the nEvent parameter set to:
• | EV_AUDIO_EXTRACT_START invoked once at the beginning |
• | EV_AUDIO_EXTRACT_PERC invoked multiple times reporting the current advancement percentage inside the nData1 parameter |
• | EV_AUDIO_EXTRACT_DONE invoked once at the end |
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. |