THPAudioDecode

C Specification

#include <revolution/tpl.h>
u32 THPAudioDecode(s16 *buffer, u8 *audioFrame, s32 flag);

Arguments

buffer Pointer to a buffer that stores extracted audio data.
audioFrame Pointer to the THP audio data.
flag Specifies the order of expanded audio data.

Return Values

Returns the number of decoded stereo samples. (Each sample of a left/right channel pair increments the count by one.)

Description

This function expands the THP audio data specified by the second argument and outputs the THP audio data to the buffer specified by the first argument. The format of the output data is specified by the third argument.

The output of the THPAudioDecodefuction becomes stereo format. This function converts THP audio data that is input in mono format into stereo format for output. This function also returns the number of decoded stereo samples for a return value. (Each sample of a left/right channel pair increments the count by one.)

flag specifies THP_AUDIO_INTERLEAVE or THP_AUDIO_NO_INTERLEAVE. If THP_AUDIO_INTERLEAVE is specified, this function interleaves the extracted data of the left/right channel pair per sample, and then outputs the data to the specified buffer. Based on the audio interface specifications for the Revolution, the interleave order is [ right, left, right, left, ... ]. If THP_AUDIO_NO_INTERLEAVE is specified, this function groups the expanded data of the left/right channel data by channel, and then outputs the data to the specified buffer. The output order is all samples for the right channel, and then all samples for the left channel..

Note: Even if the specified THP audio data is mono, regardless of the specified third argument, this function converts the expanded data into stereo format. The output buffer specified by the first argument should be the same size as the audio data in stereo format.

Note: The THPAudioDecode function does not use locked cache.

See Also

Revision History

03/01/2006 Initial version.