Functions | |
| u8 | audioDisableEcho (void) |
| Disable echo for all voices. | |
| u8 | audioEnableEcho (u8 voiceMask) |
| Enable echo for specific voices. | |
| u8 | audioReleaseEcho (void) |
| Turn the echo off and give its ring back to the samples. | |
| u8 | audioSetEcho (u8 delay, s8 feedback, s8 volumeL, s8 volumeR) |
| Configure echo parameters. | |
| u8 | audioSetEchoFilter (const s8 fir[8]) |
| Set FIR filter coefficients for echo. | |
| u8 audioDisableEcho | ( | void | ) |
Disable echo for all voices.
Mutes the echo and stops the ring's writes. The ring keeps its memory: audioEnableEcho() brings the same echo back.
Enable echo for specific voices.
| voiceMask | Bitmask (bit 0 = voice 0, etc.) |
After audioDisableEcho(), this starts the echo again as audioSetEcho() configured it, on a cleared ring (~9 ms per unit of delay in the driver; the call itself returns at once).
| u8 audioReleaseEcho | ( | void | ) |
Turn the echo off and give its ring back to the samples.
Does what audioDisableEcho() does, then frees the ring: the sample area reaches $FFC0 again (audioGetFreeMemory() counts it at once), and samples may be loaded where the ring was as soon as this returns — the driver answers only once the sound chip has stopped writing there.
For a game that wants an echo in one scene only: audioSetEcho() when the scene starts, this when it ends. audioEnableEcho() alone no longer brings an echo back afterwards; audioSetEcho() does, with its usual wait (16 ms per unit of the delay released), and it answers AUDIO_ERR_NO_MEMORY while samples loaded in the meantime occupy the ring it needs.
Configure echo parameters.
| delay | Echo delay 1-7 (delay_ms = value * 16; values above 7 are clamped). The echo ring takes delay x 2 KB at the top of the sample area: see audioGetFreeMemory() |
| feedback | Feedback amount (-128 to 127) |
| volumeL | Left echo volume (-128 to 127) |
| volumeR | Right echo volume (-128 to 127) |
This call blocks. The S-DSP takes a new delay only when the ring it is running reaches its end, so the driver keeps the ring silent for that long before it uses the new one: up to 240 ms on the first call, 16 ms per unit of the previous delay after; then it clears the new ring (~9 ms per unit). Call it at scene setup or with the screen off, never during play. To turn the same echo off and on, use audioDisableEcho() and audioEnableEcho(): they cost one command. Call this BEFORE audioEnableEcho().
Set FIR filter coefficients for echo.
| fir | Array of 8 signed coefficients |
Optional: from audioInit() the filter is { 127, 0, 0, 0, 0, 0, 0, 0 }, which passes the echo through unchanged. (Until 2026-10-13 it was all zeros, and an echo configured without this call was silent.)