sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
Effects

The SPU2 reverb and delay. More...

Topics

 Effect presets
 Values for audio_effect_set_preset().

Functions

int audio_effect_set_preset (int preset)
int audio_effect_set_depth (int depth_percent)
int audio_effect_set_delay_and_feedback (int delay, int feedback)
int audio_channel_set_effect_send (int channel, int enabled)
int audio_stream_set_effect_send (int enabled)

Detailed Description

The SPU2 reverb and delay.

One effect is active at a time. It is a mix bus that sources choose to send to: nothing is affected until audio_channel_set_effect_send() or audio_stream_set_effect_send() turns a source on. A source keeps its normal output and the effect is added to it, so the depth sets how much effect is heard. The send is on or off; there is no per-source amount.

The effect needs working memory in SPU2 RAM. Sounds that are loaded when a preset is selected may occupy the area that the effect on the stream uses, so select the preset before loading sounds, or free sounds first. audio_shutdown() turns the effect off and cuts the tail.

Function Documentation

◆ audio_channel_set_effect_send()

int audio_channel_set_effect_send ( int channel,
int enabled )

Sends a channel to the effect, or stops doing so. The setting persists across sounds.

Parameters
channel0 to 23.
enabledNon-zero to send.
Returns
AUDIO_OK or -AUDIO_ERR_INVALID_ARGUMENT.

◆ audio_effect_set_delay_and_feedback()

int audio_effect_set_delay_and_feedback ( int delay,
int feedback )

Sets the delay time and feedback of AUDIO_EFFECT_ECHO and AUDIO_EFFECT_DELAY. Other presets keep the values for later and ignore them. The defaults are 128 and 128. The scale is not calibrated to milliseconds.

Parameters
delay0 to 255; larger is a longer delay.
feedback0 to 255; larger repeats for longer. Only AUDIO_EFFECT_ECHO uses it; AUDIO_EFFECT_DELAY plays a single repeat.
Returns
AUDIO_OK or -AUDIO_ERR_INVALID_ARGUMENT.

◆ audio_effect_set_depth()

int audio_effect_set_depth ( int depth_percent)

Sets how loud the effect is in the output. The default is 50.

Parameters
depth_percent0 to 100.
Returns
AUDIO_OK or -AUDIO_ERR_INVALID_ARGUMENT.

◆ audio_effect_set_preset()

int audio_effect_set_preset ( int preset)

Selects the effect and clears its working memory. Depth, delay and feedback keep their values.

Parameters
presetOne of Effect presets. AUDIO_EFFECT_OFF turns the effect off.
Returns
AUDIO_OK, -AUDIO_ERR_INVALID_ARGUMENT or -AUDIO_ERR_OUT_OF_SPU_MEMORY when loaded sounds occupy the working memory; the previous preset stays active in that case.
Note
Blocks while the working memory is cleared, up to a few milliseconds.

◆ audio_stream_set_effect_send()

int audio_stream_set_effect_send ( int enabled)

Sends the stream to the effect, or stops doing so.

Parameters
enabledNon-zero to send.
Returns
AUDIO_OK.