NNS_SndCaptureStartOutputEffect

Syntax

#include <nnsys/snd.h>
BOOL NNS_SndCaptureStartOutputEffect(
        void* buffer_p,
        u32 bufSize,
        NNSSndCaptureOutputEffectType type );

Arguments

buffer_p The pointer to the effect buffer. Must have 32-byte alignment.
bufSize The effect buffer size. It must be a multiple of 128.
type The output effect process type.

Return Values

The function returns whether the output effect process started successfully.

Description

Starts the output effect process.

After capturing the mixer output using the capture feature and applying the effect process with the callback function, this function outputs the final sound. While the effects are being used, they consume 2 of 16 channels (channels 1 and 3). If channel 1 or channel 3 is being used by a sequence, the sounds from that channel are forcibly stopped.

To use effects, an effect buffer is required. The starting address buffer_p must have a 32-byte alignment. The buffer size is specified with bufSize and must be a multiple of 128. The smaller the effect buffer, the more frequently the effect process is executed. Conversely, the larger the effect buffer, the longer it takes to process the contents. When the effect buffer is 4 KB, the effect process is executed once per video frame.

Select an output effect type from the following:

Table. NNSSndCaptureOutputEffectType

Label Description
NNS_SND_CAPTURE_OUTPUT_EFFECT_NORMAL Normal stereo mode (no effects are processed).
NNS_SND_CAPTURE_OUTPUT_EFFECT_MONO Mono mode.
NNS_SND_CAPTURE_OUTPUT_EFFECT_SURROUND Surround mode.
NNS_SND_CAPTURE_OUTPUT_EFFECT_HEADPHONE Headphone mode.

In Surround mode, an effect is applied so that sound seems to expand from the DS stereo speakers. In Headphone mode, an effect is applied to reduce fatigue when listening to headphones.

When the NNS_SndCaptureCreateThread function starts the capture thread, the effect process is executed in the capture thread. If the capture thread is not started, it is executed with the IRQ handler.

The output effect may fail to start for one of the following reasons.

  • Capture is being used for something other than an effect
  • Channel 1 or Channel 3 is being used for something other than playing an effect or sequence

Note

If the effect process cannot run normally because interrupts are prohibited for a long time, the proper sound cannot be output.

If this function is called while sound is being played, the sound is interrupted.

In Surround mode, the sound quality may be less clear than other modes.

See Also

NNS_SndCaptureCreateThread

Revision History

2005/06/27 Added reasons for function failure.
2004/11/19 Added a note about sound distortion in Surround mode.
2004/10/04 Initial version.


CONFIDENTIAL