nn::snd::CTR::WaveBuffer Structurestruct WaveBuffer
{
const void * bufferAddress;
s32 sampleLength;
const AdpcmContext * pAdpcmContext;
uptr userParam;
bool loopFlag;
Status status;
u16 bufferId;
struct WaveBuffer * next;
};
Structure that stores information about a buffer storing sample data.
Before using a WaveBuffer structure, always initialize it by calling the nn::snd::CTR::InitializeWaveBuffer function. After initialization, set the sample address and size, and if necessary set a pointer to the ADPCM context. Then call the nn::snd::CTR::Voice::AppendWaveBuffer function to register the buffer information to a voice.
There are some restrictions on buffer addresses that are registered. See the nn::snd::CTR::Voice::AppendWaveBuffer function reference for details.
The pAdpcmContext member is only used for adpcm playback. pAdpcmContext must be specified for the first WaveBuffer appended to the voice used for adpcm playback. When pAdpcmContext is NULL for any WaveBuffer appended later, the context is not updated when buffer jumps occur (stream playback).
Use status to check the status of a buffer after it has been registered. See the nn::snd::CTR::WaveBuffer::Status enumerated type for how status values correspond to the buffer status.
Status
|
An enumerated type that indicates the buffer state. |
|---|
| bufferAddress | Address of the storage location of the sample data. Required. Do not change this after registering to a voice. | |
|---|---|---|
| sampleLength | Length of samples within the buffer. Required. Do not change this after registering to a voice. | |
| pAdpcmContext | ADPCM context address. After registering to a voice, do not change this until after buffer playback has finished. | |
| userParam | User parameter. Optional. | |
| loopFlag | Loop flag. Optional. | |
| status | Buffer status. Used by the library. Do not change. | |
| bufferId | ID used for managing the buffer. Used by the library. Do not change. | |
| next | Address of the next buffer structure. Used by the library. Do not change. |
WaveBuffer
|
Constructor. |
|---|
CONFIDENTIAL