nn::snd::CTR::WaveBuffer

nn::snd::CTR::WaveBuffer Structure

Syntax

struct WaveBuffer
{
   const void * bufferAddress;
   s32 sampleLength;
   const AdpcmContext * pAdpcmContext;
   uptr userParam;
   bool loopFlag;
   util::SizedEnum1< Status > status;
   u16 bufferId;
   struct WaveBuffer * next;
};

Description

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.

Enumerated Types

Status An enumerated type that indicates the buffer state.

Member Variables

bufferAddress const void * Address of the storage location of the sample data. Required. Do not change this after registering to a voice.
sampleLength s32 Length of samples within the buffer. Required. Do not change this after registering to a voice.
pAdpcmContext const AdpcmContext * ADPCM context address. After registering to a voice, do not change this until after buffer playback has finished.
userParam uptr User parameter. Optional.
loopFlag bool Loop flag. Optional.
status util::SizedEnum1< Status > Buffer status. Used by the library. Do not change.
bufferId u16 ID used for managing the buffer. Used by the library. Do not change.
next struct WaveBuffer * Address of the next buffer structure. Used by the library. Do not change.

Revision History

2010/07/22
Added a description of adpcm stream playback.
2010/01/29
Initial version.

CONFIDENTIAL