# NNS_SndCaptureStartReverb

## Syntax

      #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 64. The maximum value is `0x7ffc0`.
`format` | Format of the sample data.
`sampleRate` | Sampling rate.
`volume` | Volume of the reverb component. Set from 0 (minimum) to 63 (maximum).

## Return Values

Returns a value that indicates 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 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 32-byte alignment. The buffer size is specified with `bufSize` and must be a multiple of 64.

The `format` argument 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, to have the same delay time, the required reverb buffer's size needs to be twice that of the 8-bit format.

Table: `SNDCapture` Format

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

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

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

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

    Delay Time[sec] = bufSize / sampleRate / 2

The following may cause reverb to fail to start.

- Capture is being used for a feature other than reverb
- Channel 1 or 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

2008/10/07 Corrected mistakes in delay time formula.
2007/07/11 Corrected a mistake about the reverb buffer size limit.
2005/01/06 Deleted the description of TEG.
2004/07/01 Changed type of the `format` argument from `SNDCaptureFormat` to `NNSSndCaptureFormat`.
2004/04/01 Initial version.

CONFIDENTIAL