Leadtools.Codecs Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.12.17
GetAudioData Method
See Also 
Leadtools.Codecs Namespace > CodecsExtensionList Class : GetAudioData Method




stream
Index of the audio stream to retrieve. The extensions may have more than one audio stream. This index is 0-based. Therefore, the first stream is stream 0, the second stream is stream 1, etc. To retrieve all the audio streams, retrieve the streams one by one until an empty RasterNativeBuffer is returned (empty RasterNativeBuffer will have a RasterNativeBuffer.Data set to IntPtr.Zero and RasterNativeBuffer.Length set to 0.
Gets the embedded audio data from the specified extension list.

Syntax

Visual Basic (Declaration) 
Public Function GetAudioData( _
   ByVal stream As Integer _
) As RasterNativeBuffer
Visual Basic (Usage)Copy Code
Dim instance As CodecsExtensionList
Dim stream As Integer
Dim value As RasterNativeBuffer
 
value = instance.GetAudioData(stream)
C# 
public RasterNativeBuffer GetAudioData( 
   int stream
)
Managed Extensions for C++ 
public: RasterNativeBuffer GetAudioData( 
   int stream
) 
C++/CLI 
public:
RasterNativeBuffer GetAudioData( 
   int stream
) 

Parameters

stream
Index of the audio stream to retrieve. The extensions may have more than one audio stream. This index is 0-based. Therefore, the first stream is stream 0, the second stream is stream 1, etc. To retrieve all the audio streams, retrieve the streams one by one until an empty RasterNativeBuffer is returned (empty RasterNativeBuffer will have a RasterNativeBuffer.Data set to IntPtr.Zero and RasterNativeBuffer.Length set to 0.

Return Value

A RasterNativeBuffer object containing the audio data.

Example

For an example, refer to RasterCodecs.ReadExtensions.

Remarks

The audio data is stored inside extensions in the WAVE format.

The audio data can be played directly from memory, or the data can be written to a disk file and played from the disk. When writing the audio data to a disk file, give the file a .WAV extension.

The audio data pointer returned is freed automatically when this CodecsExtensionList object is disposed. so do not try to free this memory.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also