Copyright © 2001-2019 MultiMedia Soft

VideoPlayer.AudioTrackExtract method

Previous pageReturn to chapter overviewNext page

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 object section.

For details about video clips rendering refer to the How to play video files through DirectShow tutorial.

 

 

Syntax

 

[Visual Basic]

control.VideoPlayer.AudioTrackExtract (

nPlayer as Integer,

bStoreInMemory as enumBoolean

) as enumErrorCodes


 

[C++]

short control.VideoPlayer.AudioTrackExtract (

short nPlayer,

short bStoreInMemory

);


 

 

 

Parameter

Description

 

 

nPlayer

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:

Mnemonic constant

Value

Meaning

BOOL_FALSE

0

Store extracted audio stream inside a temporary file; once completed, the absolute pathname of the temporary file and its size in bytes can be accessed through the VideoPlayer.AudioTrackGetTempFilePathname and VideoPlayer.AudioTrackGetTempFileSize methods.

BOOL_TRUE

1

Store extracted audio stream inside a memory buffer; once completed, this buffer and its size in bytes can be accessed through the VideoPlayer.AudioTrackGetMemoryPtr and VideoPlayer.AudioTrackGetMemorySize methods.

In case there should be not enough memory room to store the audio stream, the control would automatically switch its output to a temporary file and this would be notified through the bOutputSwitchedToFile parameter of the AudioExtractFromVideoDone event

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful