Functions | |
| u8 | audioPlaySample (u8 sampleId) |
| Play a sample with default settings. | |
| u8 | audioPlaySampleEx (u8 sampleId, u8 volume, u8 pan, u16 pitch) |
| Play a sample with custom settings. | |
| u8 | audioPlaySampleOn (u8 voice, u8 sampleId, u8 volume, u8 pan, u16 pitch) |
| Play a sample on a voice YOU choose. | |
| u8 | audioStopAll (void) |
| Stop all audio playback. | |
| u8 | audioStopVoice (u8 voice) |
| Stop a specific voice. | |
Play a sample with default settings.
| sampleId | Sample slot (0-63) |
Plays at full volume, center pan, default pitch.
Play a sample with custom settings.
| sampleId | Sample slot (0-63) |
| volume | Volume level (0-127) |
| pan | Pan position (0=left, 8=center, 15=right) |
| pitch | Pitch value ($1000 = normal) |
Play a sample on a voice YOU choose.
audioPlaySample() and audioPlaySampleEx() pick the voice round-robin and only tell you afterwards. That is too late for anything that must be set BEFORE key-on — audioSetADSR() / audioSetGain() shape the attack — and it lets a long sound be stolen by the eighth effect after it. Choosing the voice fixes both: reserve, say, voice 7 for the engine hum, aim its envelope once, and keep effects on the automatic voices. (Added 2026-09-21; AUDIO_VOICE_AUTO had been defined since v2 with nothing to pass it to.)
An explicit voice does not advance the round-robin counter.
| voice | Voice 0-7, or AUDIO_VOICE_AUTO for the round-robin choice |
| sampleId | Sample slot (0-63) |
| volume | Volume level (0-127) |
| pan | Pan position (0=left, 8=center, 15=right) |
| pitch | Pitch value ($1000 = normal) |
| u8 audioStopAll | ( | void | ) |
Stop all audio playback.