|
sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
|
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) |
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.
| 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.
| channel | 0 to 23. |
| enabled | Non-zero to send. |
| 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.
| delay | 0 to 255; larger is a longer delay. |
| feedback | 0 to 255; larger repeats for longer. Only AUDIO_EFFECT_ECHO uses it; AUDIO_EFFECT_DELAY plays a single repeat. |
| int audio_effect_set_depth | ( | int | depth_percent | ) |
Sets how loud the effect is in the output. The default is 50.
| depth_percent | 0 to 100. |
| int audio_effect_set_preset | ( | int | preset | ) |
Selects the effect and clears its working memory. Depth, delay and feedback keep their values.
| preset | One of Effect presets. AUDIO_EFFECT_OFF turns the effect off. |
| int audio_stream_set_effect_send | ( | int | enabled | ) |
Sends the stream to the effect, or stops doing so.
| enabled | Non-zero to send. |