nn::snd::CTR NamespaceSound (SND) namespace. (This can also be written with "CTR" omitted.)
Sound processing is carried out while synchronizing with the DSP by sound threads that include the nn::snd::CTR::WaitForDspSync and nn::snd::CTR::SendParameterToDsp functions. Sound operations and parameter settings are configured after using the nn::snd::CTR::WaitForDspSync function to wait for an interrupt from the DSP that occurs approximately every 4.889 milliseconds, and then applying those operations and parameter settings to the DSP using the nn::snd::CTR::SendParameterToDsp function. The nn::snd::CTR::WaitForDspSync and nn::snd::CTR::SendParameterToDsp functions must be called alternately.
The snd library uses an nn::os::Event object held internally to perform the above synchronization.
The nn::dsp::CTR::Initialize function and functions for loading DSP components (such as the nn::dsp::CTR::LoadDefaultComponent function), must be called before the nn::snd::CTR::Initialize function.
Since there is no method of recovery if an API that returns Result returns an error, treat such an error as a fatal error.
Result |
|
|---|---|
nn::snd::CTR::ResultAlreadyInitialized
|
Indicates that initialization has already finished. |
nn::snd::CTR::ResultNoDspComponentLoaded
|
Indicates that dspcomponent has not been loaded. |
nn::snd::CTR::ResultInvalidUsage
|
Indicates a usage error, such as the order of arguments and function calls. |
| Other | |
nn::snd::CTR::Bcwav
|
Definition of a class that handles BCWAV files. |
nn::snd::CTR::DspFxDelay
|
A class used to control DSP delay effects. |
nn::snd::CTR::DspFxReverb
|
A class used to control DSP reverb effects. |
nn::snd::CTR::FxDelay
|
The delay effect class. |
nn::snd::CTR::FxReverb
|
The reverb effect class. |
nn::snd::CTR::OutputCapture
|
The class for getting the DSP's final output. |
nn::snd::CTR::Voice
|
A class used to control Voice objects. |
nn::snd::CTR::AdpcmParam
|
A structure that stores ADPCM coefficients. |
|---|---|
nn::snd::CTR::AdpcmContext
|
A structure that stores an ADPCM context. |
nn::snd::CTR::MonoFilterCoefficients
|
Structure that stores monopole filter coefficients. |
nn::snd::CTR::BiquadFilterCoefficients
|
Structure that stores biquad filter coefficients. |
nn::snd::CTR::MixParam
|
A structure that stores the gain for each channel. |
nn::snd::CTR::WaveBuffer
|
Structure that stores information about a buffer storing sample data. |
nn::snd::CTR::AuxBusData
|
Structure for functions containing the code that processes Aux bus data in each sound frame. |
| Voice Controls | ||
|---|---|---|
| VoiceDropMode | Mode related to voice drop handling. | |
| Other | ||
ChannelIndex
|
Enumerated type representing channel positions. | |
OutputMode
|
Enumerated type representing a mixer's output mode. | |
ClippingMode
|
Enumerated type representing the clipping mode. | |
SurroundSpeakerPosition
|
Enumerated type indicating the virtual speaker position for 3D surround sound. | |
InterpolationType
|
An enumerated type representing the interpolation method. | |
FilterType
|
Enumerated type representing the filter type. | |
AuxBusId
|
Enumerated type representing the Aux bus ID. |
|
SampleFormat
|
Enumerated type representing sample formats. | |
typedef Definitions
AuxCallback
|
Typedef for the Aux callback function pointer. |
|
|---|---|---|
VoiceDropCallbackFunc
|
Typedef for the callback function to invoke when the library frees a voice. |
| S |
VOICE_PRIORITY_NODROP
|
const s32 | This is the highest possible priority and is also given special treatment. |
|---|---|---|---|
| S |
NN_SND_DSP_MAXIMUM_CYCLES
|
const s32 | Maximum number of DSP cycles per sound frame. |
| Voice Controls | ||
|---|---|---|
AllocVoice
|
Gets a voice. | |
FreeVoice
|
Frees a voice. | |
| SetVoiceDropMode | Sets the mode to use for voice drop handling. | |
| Initialize/Finalize | ||
Initialize
|
Initializes the sound library. | |
Finalize
|
Finalizes the sound library. | |
InitializeWaveBuffer
|
Initializes a buffer information structure. | |
| Cache Operations | ||
FlushDataCache
|
Writes data for the specified cache range back into memory and invalidates the cache. | |
| Synchronous Processing | ||
WaitForDspSync
|
Receives the result of DSP processing. | |
SendParameterToDsp
|
Applies the configured parameters to the DSP. | |
| Master Controls, Auxiliary Bus Controls | ||
SetMasterVolume
|
This function sets the master volume. | |
GetMasterVolume
|
Gets the master volume. | |
SetAuxReturnVolume
|
Sets the Aux bus volume. |
|
SetAuxReturnVolume
|
Gets the Aux bus volume. |
|
RegisterAuxCallback
|
Sets the Aux bus callback function. |
|
GetAuxCallback
|
Gets the Aux bus callback function. |
|
ClearAuxCallback
|
Clears the Aux bus callback function. |
|
SetAuxFrontBypass
|
Configures whether to bypass the front channels of an Aux bus. | |
| 3D Surround Sound | ||
SetSoundOutputMode
|
Sets the sound output mode. | |
GetSoundOutputMode
|
Gets the sound output mode. | |
SetClippingMode
|
Sets the clipping mode. | |
GetClippingMode
|
Gets the clipping mode. | |
SetSurroundDepth
|
Sets the surround sound depth. | |
SetSurroundSpeakerPosition
|
Sets the virtual speaker position for 3D surround sound. | |
| Get the DSP final output | ||
GetMixedBusData
|
Copies the Mix bus data to the specified buffer. |
|
SetOutputCapture
|
Configures the capture for getting the DSP final output. | |
| Dropped Processing Detection | ||
GetDroppedSoundFrameCount
|
Gets the number of dropped sound frames. | |
ClearDroppedSoundFrameCount
|
Clears the dropped sound frames counter. | |
| DSP-ADPCM-Related | ||
EncodeAdpcmData
|
Encodes 16-bit PCM data into DSP-ADPCM format. | |
DecodeAdpcmData
|
Decodes DSP-ADPCM data. | |
GetAdpcmOutputBufferSize
|
Returns the size of the output buffer that is required during encoding. | |
ConvertAdpcmPos2Nib
|
Converts the sample position to a number of nibbles. | |
ConvertAdpcmNib2Pos
|
Converts the number of nibbles to a sample position. | |
| Effect | ||
SetEffect
|
Configures the effect. | |
ClearEffect
|
Clears an effect setting. | |
| Other | ||
GetSampleLength
|
Gets the sample length. | |
SetMaximumDspCycles
|
Sets the number of DSP cycles that sound can use. | |
GetMaximumDspCycles
|
Gets the number of DSP cycles allocated to sound. | |
GetDspCycles
|
Gets the number of cycles consumed by the DSP to create the last audio frame. | |
GetHeadphoneStatus
|
Gets whether headphones are plugged in. | |
UpdateHeadphoneStatus
|
Updates and gets the headphone connection state. | |
SetOutputBufferCount
|
Sets the number of buffers for the DSP final output level. | |
GetOutputBufferCount
|
Gets the number of buffers for the DSP final output level. | |
CONFIDENTIAL