libctru
v2.4.1
|
Interface for Nintendo's default DSP component. More...
#include <3ds/os.h>
Go to the source code of this file.
Data Structures | |
struct | ndspAdpcmData |
ADPCM data. More... | |
struct | ndspWaveBuf |
Wave buffer struct. More... | |
Macros | |
#define | NDSP_SAMPLE_RATE (SYSCLOCK_SOC / 512.0) |
Functions | |
Initialization and basic operations | |
void | ndspUseComponent (const void *binary, u32 size, u16 progMask, u16 dataMask) |
Sets up the DSP component. More... | |
Result | ndspInit (void) |
Initializes NDSP. | |
void | ndspExit (void) |
Exits NDSP. | |
u32 | ndspGetDroppedFrames (void) |
Gets the number of dropped sound frames. More... | |
u32 | ndspGetFrameCount (void) |
Gets the total sound frame count. More... | |
General parameters | |
void | ndspSetMasterVol (float volume) |
Sets the master volume. More... | |
float | ndspGetMasterVol (void) |
Gets the master volume. More... | |
void | ndspSetOutputMode (ndspOutputMode mode) |
Sets the output mode. More... | |
ndspOutputMode | ndspGetOutputMode (void) |
Gets the output mode. More... | |
void | ndspSetClippingMode (ndspClippingMode mode) |
Sets the clipping mode. More... | |
ndspClippingMode | ndspGetClippingMode (void) |
Gets the clipping mode. More... | |
void | ndspSetOutputCount (int count) |
Sets the output count. More... | |
int | ndspGetOutputCount (void) |
Gets the output count. More... | |
void | ndspSetCapture (ndspWaveBuf *capture) |
Sets the wave buffer to capture audio to. More... | |
void | ndspSetCallback (ndspCallback callback, void *data) |
Sets the sound frame callback. More... | |
Surround | |
void | ndspSurroundSetDepth (u16 depth) |
Sets the surround sound depth. More... | |
u16 | ndspSurroundGetDepth (void) |
Gets the surround sound depth. More... | |
void | ndspSurroundSetPos (ndspSpeakerPos pos) |
Sets the surround sound position. More... | |
ndspSpeakerPos | ndspSurroundGetPos (void) |
Gets the surround sound position. More... | |
void | ndspSurroundSetRearRatio (u16 ratio) |
Sets the surround sound rear ratio. More... | |
u16 | ndspSurroundGetRearRatio (void) |
Gets the surround sound rear ratio. More... | |
Auxiliary output | |
void | ndspAuxSetEnable (int id, bool enable) |
Configures whether an auxiliary output is enabled. More... | |
bool | ndspAuxIsEnabled (int id) |
Gets whether auxiliary output is enabled. More... | |
void | ndspAuxSetFrontBypass (int id, bool bypass) |
Configures whether an auxiliary output should use front bypass. More... | |
bool | ndspAuxGetFrontBypass (int id) |
Gets whether auxiliary output front bypass is enabled. More... | |
void | ndspAuxSetVolume (int id, float volume) |
Sets the volume of an auxiliary output. More... | |
float | ndspAuxGetVolume (int id) |
Gets the volume of an auxiliary output. More... | |
void | ndspAuxSetCallback (int id, ndspAuxCallback callback, void *data) |
Sets the callback of an auxiliary output. More... | |
Data types | |
enum | ndspOutputMode { NDSP_OUTPUT_MONO = 0 , NDSP_OUTPUT_STEREO = 1 , NDSP_OUTPUT_SURROUND = 2 } |
enum | ndspClippingMode { NDSP_CLIP_NORMAL = 0 , NDSP_CLIP_SOFT = 1 } |
enum | ndspSpeakerPos { NDSP_SPKPOS_SQUARE = 0 , NDSP_SPKPOS_WIDE = 1 , NDSP_SPKPOS_NUM = 2 } |
enum | { NDSP_WBUF_FREE = 0 , NDSP_WBUF_QUEUED = 1 , NDSP_WBUF_PLAYING = 2 , NDSP_WBUF_DONE = 3 } |
Wave buffer status. More... | |
typedef void(* | ndspCallback) (void *data) |
Sound frame callback function. (data = User provided data) | |
typedef void(* | ndspAuxCallback) (void *data, int nsamples, void *samples[4]) |
Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data) | |
Interface for Nintendo's default DSP component.
anonymous enum |
enum ndspClippingMode |
enum ndspOutputMode |
enum ndspSpeakerPos |
bool ndspAuxGetFrontBypass | ( | int | id | ) |
Gets whether auxiliary output front bypass is enabled.
id | ID of the auxiliary output. |
float ndspAuxGetVolume | ( | int | id | ) |
Gets the volume of an auxiliary output.
id | ID of the auxiliary output. |
bool ndspAuxIsEnabled | ( | int | id | ) |
Gets whether auxiliary output is enabled.
id | ID of the auxiliary output. |
void ndspAuxSetCallback | ( | int | id, |
ndspAuxCallback | callback, | ||
void * | data | ||
) |
Sets the callback of an auxiliary output.
id | ID of the auxiliary output. |
callback | Callback to set. |
data | User-defined data to pass to the callback. |
void ndspAuxSetEnable | ( | int | id, |
bool | enable | ||
) |
Configures whether an auxiliary output is enabled.
id | ID of the auxiliary output. |
enable | Whether to enable the auxiliary output. |
void ndspAuxSetFrontBypass | ( | int | id, |
bool | bypass | ||
) |
Configures whether an auxiliary output should use front bypass.
id | ID of the auxiliary output. |
bypass | Whether to use front bypass. |
void ndspAuxSetVolume | ( | int | id, |
float | volume | ||
) |
Sets the volume of an auxiliary output.
id | ID of the auxiliary output. |
volume | Volume to set. |
ndspClippingMode ndspGetClippingMode | ( | void | ) |
Gets the clipping mode.
u32 ndspGetDroppedFrames | ( | void | ) |
Gets the number of dropped sound frames.
u32 ndspGetFrameCount | ( | void | ) |
Gets the total sound frame count.
float ndspGetMasterVol | ( | void | ) |
Gets the master volume.
int ndspGetOutputCount | ( | void | ) |
Gets the output count.
ndspOutputMode ndspGetOutputMode | ( | void | ) |
Gets the output mode.
void ndspSetCallback | ( | ndspCallback | callback, |
void * | data | ||
) |
Sets the sound frame callback.
callback | Callback to set. |
data | User-defined data to pass to the callback. |
void ndspSetCapture | ( | ndspWaveBuf * | capture | ) |
Sets the wave buffer to capture audio to.
capture | Wave buffer to capture to. |
void ndspSetClippingMode | ( | ndspClippingMode | mode | ) |
Sets the clipping mode.
mode | Clipping mode to set. Defaults to NDSP_CLIP_SOFT. |
void ndspSetMasterVol | ( | float | volume | ) |
Sets the master volume.
volume | Volume to set. Defaults to 1.0f. |
void ndspSetOutputCount | ( | int | count | ) |
Sets the output count.
count | Output count to set. Defaults to 2. |
void ndspSetOutputMode | ( | ndspOutputMode | mode | ) |
Sets the output mode.
mode | Output mode to set. Defaults to NDSP_OUTPUT_STEREO. |
u16 ndspSurroundGetDepth | ( | void | ) |
Gets the surround sound depth.
ndspSpeakerPos ndspSurroundGetPos | ( | void | ) |
Gets the surround sound position.
u16 ndspSurroundGetRearRatio | ( | void | ) |
Gets the surround sound rear ratio.
void ndspSurroundSetDepth | ( | u16 | depth | ) |
Sets the surround sound depth.
depth | Depth to set. Defaults to 0x7FFF. |
void ndspSurroundSetPos | ( | ndspSpeakerPos | pos | ) |
Sets the surround sound position.
pos | Position to set. Defaults to NDSP_SPKPOS_SQUARE. |
void ndspSurroundSetRearRatio | ( | u16 | ratio | ) |
Sets the surround sound rear ratio.
ratio | Rear ratio to set. Defaults to 0x8000. |