NNS_SndCaptureStartReverb

C Specification

#include <nnsys/snd.h>
BOOL NNS_SndCaptureStartReverb(
        void* buffer_p,
        u32 bufSize,
        NNSSndCaptureFormat format,
        int sampleRate,
        int volume );

Arguments

buffer_p Pointer to reverb buffer. Must have 32-byte alignment.
bufSize Reverb buffer size. Must be a multiple of 32. The maximum value is 0x7fff8.
format The format of the sample data.
sampleRate This is the sampling rate.
volume Volume of the reverb component. Set from 0 (minimum) - 63 (maximum).

Return Values

Returns a value indicating whether reverb has started successfully.

Description

Starts the reverb feature.

Reverb is produced by using the capture feature to capture mixer output and then output back to the mixer after a delay. Two of the 16 channels (Channel 1 and Channel 3) are used during reverb. If channel 1 or channel 3 is being used by a sequence, the sounds from that channel are forcibly stopped.

Reverb requires a reverb buffer. The bigger the reverb buffer, the longer the delay and the deeper the reverb effect. The starting address buffer_p must have a 32-byte alignment. The buffer size is specified with bufSize and must be a multiple of 32.

format takes one of the two values shown in the following table for the sample data format. Although the 16-bit format has better sound quality, it requires a reverb buffer of twice the size as for the 8-bit format to have the same delay time.

Table: SNDCapture Format

Label Description
NNS_SND_CAPTURE_FORMAT_PCM8 8-bit PCM
NNS_SND_CAPTURE_FORMAT_PCM16 16-bit PCM

sampleRate is the number of samples to be captured per time unit. Although larger values result in better sound quality reverb components, the delay time will be shortened by that amount. To preserve the same delay time, the reverb buffer size must be increased.

volume is the volume of the reverb component. When set to the maximum of 63, about half of the mixer output volume is fed back as reverberation.

The equation to obtain the reverb delay time is shown below. Note that when the format is 16-bit PCM, the delay time is half that shown.

Delay Time[sec] = bufSize / sampleRate

The following may cause reverb to fail to start.

  • Capture is being used for a feature other than reverb
  • Channel 1 or Channel 3 is being used to play something other than reverberation or a sequence

Note

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

See Also

None.

Revision History

2005/01/06 Deleted the description regarding TEG.

2004/07/01 Changed the type of the format argument from SNDCaptureFormat to NNSSndCaptureFormat.

2004/04/01 Initial version.


CONFIDENTIAL