ndsaudio sample specification C Prototype: ----------------------------------- typedef struct _audioSample { u32 point; u32 length; u8 format; u8 repeat; u16 dfreq; const void *pdata; } audioSample; ----------------------------------- point Sample loop point. Specified in 32-bit "word" units Loop starts at x*4 for 8bit samples, x*2 for 16bit samples, and x*8 for adpcm samples length Sample length or loop length, specified in words Length of sample loop (or entire sample for one-shot) will be x*4 samples for 8bit, x*2 samples for 16bit, or x*8 samples for adpcm format 0 = 8BIT PCM 1 = 16BIT PCM 2 = IMA-ADPCM (4BIT) repeat 1 = loop infinite 2 = one-shot "point" must be set to zero when using one-shot dfreq default sampling rate in "hz/32" units, 1024=32khz pdata pointer to sample data if "pdata" is zero then the sample data will be expected to follow directly after the struct --------------------------------------------------------------------------- Notes on MODE1 audio mode: MODE1 interpolation routines cannot handle sample input "-max", when using MODE1 clamp sample range to [-127,127] (8bit) or [-32767,32767] (16bit) MODE1 also expects 1 (or 2?) extra samples past the end of the sample the extra samples should be 0 for one shot samples, or copies of the samples at the loop starting point. --------------------------------------------------------------------------- Other notes: IMA-ADPCM format is not supported on MODE1,MODE2. MODE2 discards the LSB of 16-bit samples (8bit mixer input only)