Copyright © 2008-2019 MultiMedia Soft

EncodeFormats.ACM.GetCodecFormatWavData method

Previous pageReturn to chapter overviewNext page

Remarks

 

Obtains the WAVEFORMATEX data structure, which defines the format of waveform-audio data, that describes the format of the given ACM codec including any extra-byte the specific format may require.

 

The WAVEFORMATEX structure, common to all waveform-audio formats, is defined inside the Microsoft SDK as follows:

typedef struct {

 WORD  wFormatTag;

 WORD  nChannels;

 DWORD nSamplesPerSec;

 DWORD nAvgBytesPerSec;

 WORD  nBlockAlign;

 WORD  wBitsPerSample;

 WORD  cbSize;

} WAVEFORMATEX;

 

The cbSize member defines how many extra-bytes are appended to the end of the WAVEFORMATEX structure: the total size in bytes of the WAVEFORMATEX data structure that describes the given format, including any extra-byte the specific format may require, can be obtained using the EncodeFormats.ACM.GetCodecFormatWavDataLength method.

 

For further details about using the Windows Audio Compression Manager refer to the EncodeACM class section.

For a tutorial about the use of the Windows Audio Compression Manager refer to the How to use the Windows Audio Compression Manager section.

For further information about available encoding formats see the EncodeFormatsMan class.

 

 

Syntax

 

[Visual Basic]

Public Function GetCodecFormatWavData (

nCodecIndex as Int16,

nCodecFormatIndex as Int16,

pWavData() as Byte,

sizeWavData as Int32

) as enumErrorCodes


 

[C#]

public enumErrorCodes GetCodecFormatWavData (

Int16 nCodecIndex,

Int16 nCodecFormatIndex,

byte [] pWavData,

Int32 sizeWavData

);


 

[C++]

public: enumErrorCodes GetCodecFormatWavData (

Int16 nCodecIndex,

Int16 nCodecFormatIndex,

unsigned char __gc[] pWavData,

Int32 sizeWavData

);


 

 

Parameter

Description

 

 

nCodecIndex

Number representing the zero-based index of the ACM codec

nCodecFormatIndex

Number representing the zero-based index of the format for the given ACM codec

pWavData

Memory buffer that, on exit from the method's call, will contain the given codec's format description: this buffer should be allocated through a global variable in order to avoid becoming invalid when the variable will go out of scope.

sizeWavData

The size in bytes of the WAVEFORMATEX data structure, including any extra-byte the specific format may require: this parameter should be initialized using a previous call to the EncodeFormats.ACM.GetCodecFormatWavDataLength method

 

 

 

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