9#define NDSP_SAMPLE_RATE (SYSCLOCK_SOC / 512.0)
bool ndspAuxGetFrontBypass(int id)
Gets whether auxiliary output front bypass is enabled.
float ndspAuxGetVolume(int id)
Gets the volume of an auxiliary output.
u32 ndspGetDroppedFrames(void)
Gets the number of dropped sound frames.
void ndspSetOutputCount(int count)
Sets the output count.
ndspClippingMode
Definition ndsp.h:23
@ NDSP_CLIP_NORMAL
"Normal" clipping mode (?)
Definition ndsp.h:24
@ NDSP_CLIP_SOFT
"Soft" clipping mode (?)
Definition ndsp.h:25
ndspSpeakerPos ndspSurroundGetPos(void)
Gets the surround sound position.
bool ndspAuxIsEnabled(int id)
Gets whether auxiliary output is enabled.
u16 ndspSurroundGetRearRatio(void)
Gets the surround sound rear ratio.
void ndspAuxSetCallback(int id, ndspAuxCallback callback, void *data)
Sets the callback of an auxiliary output.
float ndspGetMasterVol(void)
Gets the master volume.
void ndspSetOutputMode(ndspOutputMode mode)
Sets the output mode.
void ndspSurroundSetPos(ndspSpeakerPos pos)
Sets the surround sound position.
void ndspUseComponent(const void *binary, u32 size, u16 progMask, u16 dataMask)
Sets up the DSP component.
void ndspAuxSetFrontBypass(int id, bool bypass)
Configures whether an auxiliary output should use front bypass.
void ndspSetCallback(ndspCallback callback, void *data)
Sets the sound frame callback.
ndspClippingMode ndspGetClippingMode(void)
Gets the clipping mode.
u16 ndspSurroundGetDepth(void)
Gets the surround sound depth.
@ NDSP_WBUF_QUEUED
The wave buffer is queued and has not been played yet.
Definition ndsp.h:51
@ NDSP_WBUF_FREE
The wave buffer is not queued.
Definition ndsp.h:50
@ NDSP_WBUF_PLAYING
The wave buffer is playing right now.
Definition ndsp.h:52
@ NDSP_WBUF_DONE
The wave buffer has finished being played.
Definition ndsp.h:53
void(* ndspCallback)(void *data)
Sound frame callback function. (data = User provided data)
Definition ndsp.h:78
u32 ndspGetFrameCount(void)
Gets the total sound frame count.
ndspOutputMode ndspGetOutputMode(void)
Gets the output mode.
void ndspAuxSetEnable(int id, bool enable)
Configures whether an auxiliary output is enabled.
void ndspExit(void)
Exits NDSP.
void ndspSetMasterVol(float volume)
Sets the master volume.
ndspOutputMode
Definition ndsp.h:15
@ NDSP_OUTPUT_MONO
Mono sound.
Definition ndsp.h:16
@ NDSP_OUTPUT_STEREO
Stereo sound.
Definition ndsp.h:17
@ NDSP_OUTPUT_SURROUND
3D Surround sound
Definition ndsp.h:18
ndspSpeakerPos
Definition ndsp.h:30
@ NDSP_SPKPOS_WIDE
?
Definition ndsp.h:32
@ NDSP_SPKPOS_NUM
?
Definition ndsp.h:33
@ NDSP_SPKPOS_SQUARE
?
Definition ndsp.h:31
void ndspSurroundSetDepth(u16 depth)
Sets the surround sound depth.
void ndspSetCapture(ndspWaveBuf *capture)
Sets the wave buffer to capture audio to.
void(* ndspAuxCallback)(void *data, int nsamples, void *samples[4])
Auxiliary output callback function. (data = User provided data, nsamples = Number of samples,...
Definition ndsp.h:80
void ndspAuxSetVolume(int id, float volume)
Sets the volume of an auxiliary output.
int ndspGetOutputCount(void)
Gets the output count.
void ndspSetClippingMode(ndspClippingMode mode)
Sets the clipping mode.
Result ndspInit(void)
Initializes NDSP.
void ndspSurroundSetRearRatio(u16 ratio)
Sets the surround sound rear ratio.
ADPCM data.
Definition ndsp.h:38
s16 history0
Last outputted PCM16 sample.
Definition ndsp.h:40
s16 history1
Second to last outputted PCM16 sample.
Definition ndsp.h:41
u16 index
Current predictor index.
Definition ndsp.h:39
Wave buffer struct.
Definition ndsp.h:58
const void * data_vaddr
Data virtual address.
Definition ndsp.h:64
s8 * data_pcm8
Pointer to PCM8 sample data.
Definition ndsp.h:61
ndspWaveBuf * next
Next buffer to play. Used internally, do not modify.
Definition ndsp.h:74
bool looping
Whether to loop the buffer.
Definition ndsp.h:70
u8 * data_adpcm
Pointer to DSPADPCM sample data.
Definition ndsp.h:63
u16 sequence_id
Sequence ID. Assigned automatically by ndspChnWaveBufAdd.
Definition ndsp.h:73
ndspAdpcmData * adpcm_data
ADPCM data.
Definition ndsp.h:67
u32 nsamples
Total number of samples (PCM8=bytes, PCM16=halfwords, DSPADPCM=nibbles without frame headers)
Definition ndsp.h:66
u8 status
Queuing/playback status.
Definition ndsp.h:71
s16 * data_pcm16
Pointer to PCM16 sample data.
Definition ndsp.h:62
u32 offset
Buffer offset. Only used for capture.
Definition ndsp.h:69
uint8_t u8
would be nice if newlib had this already
Definition types.h:21
int8_t s8
8-bit signed integer
Definition types.h:26
int16_t s16
16-bit signed integer
Definition types.h:27
s32 Result
Function result.
Definition types.h:42
uint16_t u16
16-bit unsigned integer
Definition types.h:22
uint32_t u32
32-bit unsigned integer
Definition types.h:23