AXDecodeAdpcmData

Syntax

#include <revolution/ax.h>

s32 AXDecodeAdpcmData(u8*       input,
                      DSPADPCM* info,
                      s32       samples,
                      s16*      output);

Arguments

input Pointer to DSP-ADPCM data to be decoded into 16-bit PCM data.
info Pointer to the DSP-ADPCM data information.
samples Number of samples to be decoded.
output Pointer to the location to output the 16-bit PCM data.

Return Values

Returns the number of samples that were actually decoded.

Description

Decodes DSP-ADPCM format data into monaural 16-bit PCM data (big-endian). The CPU does the decoding. This function is primarily used to decode DSP-ADPCM data that has been encoded by the AXGetAdpcmData function.

The second argument, info, specifies the location in which to store information about the DSP-ADPCM data specified in the first argument.

The third argument, samples, specifies the number of samples to decode. If the number of samples inside the DSP-ADPCM data is less than samples, this function terminates when it has finished decoding all the DSP-ADPCM data. However, if the DSP-ADPCM data includes a loop, this function continues the loop until the number of samples decoded reaches the value given by samples.

The fourth argument, output, specifies the location to output the 16-bit PCM data. Memory of size samples × sizeof(s16), where samples is the second argument, must be preallocated for the region to use for outputting converted data. If the region specified here as the output location is accessed directly by AX, its address must be 4-byte aligned.

See Also

AXGetAdpcmData

Revision History

2008/12/17 Initial version.


CONFIDENTIAL