#include <nitro/snd.h>
typedef struct SNDWaveParam
{
u8 format;
u8 loopflag;
u16 rate;
u16 timer;
u16 loopstart;
u32 looplen;
} SNDWaveParam;
typedef struct SNDWaveData
{
struct SNDWaveParam param;
u8 samples[0];
} SNDWaveData;
format |
Sample format. |
loopflag |
Loop flag. If zero, there is no loop. If non-zero, a loop exists. |
rate |
Sampling rate. It is expressed in MHz. |
timer |
Description. It corresponds to SND_TIMER_CLOCK / rate. |
loopstart |
Starting point of the loop. It is expressed in words (32-bit). |
looplen |
Length of the loop. If there is no loop, this corresponds to the length of the waveform. It is expressed in words (32-bit). |
samples |
Array of the sample data. The size of the array, in words, is loopstart + looplen .
|
Waveform data structure. It holds the header information and the sample data for the waveform data.
The sample format format
takes one of the following values.
Table. SNDWaveFormat
Label | Description |
---|---|
SND_WAVE_FORMAT_PCM8 |
8-bit PCM |
SND_WAVE_FORMAT_PCM16 |
16-bit PCM |
SND_WAVE_FORMAT_ADPCM |
IMA-ADPCM |
If the sample format is SND_WAVE_FORMAT_ADPCM
, ADPCM header information similar to the following is stored in the first word of the sample data samples
.
struct { s16 prevsample; // Previous sample value u8 previndex; // Previous index value u8 padding; // Padding (always 0) };
None.
2005/01/19 Initial version.
CONFIDENTIAL