Functions | |
| u16 | audioGetFreeMemory (void) |
| Get available SPC700 RAM for samples. | |
| u8 | audioGetSampleInfo (u8 id, AudioSample *info) |
| Get information about a loaded sample. | |
| u8 | audioLoadSample (u8 id, const u8 *brrData, u16 size, u16 loopPoint) |
| Load a BRR sample into SPC700 RAM. | |
| void | audioUnloadSample (u8 id) |
| Unload a sample from a slot. | |
| u16 audioGetFreeMemory | ( | void | ) |
Get available SPC700 RAM for samples.
The sample area starts at $0B00 of the sound CPU's 64 KB (below it: the driver and the sample directory) and ends
| u8 audioGetSampleInfo | ( | u8 | id, |
| AudioSample * | info ) |
Get information about a loaded sample.
| id | Sample ID |
| info | Pointer to AudioSample struct to fill |
Load a BRR sample into SPC700 RAM.
| id | Sample slot (0-63) |
| brrData | Pointer to BRR sample data |
| size | Size in bytes (must be multiple of 9) |
| loopPoint | Loop offset in bytes from the start of the sample (a multiple of 9, one BRR block). It is where a sample that loops comes back to — 0 for a loop from the very start. WHETHER the sample loops is the loop flag of its last BRR block (opensnes-sample sets it), not this value: a one-shot sample ignores it. |
| void audioUnloadSample | ( | u8 | id | ) |
Unload a sample from a slot.
| id | Sample slot (0-63) |
It does NOT stop a voice that is playing the sample — stop it first. The allocator is a bump pointer: SPC memory comes back only when the sample unloaded is the most recently loaded one, and loading a slot that is already loaded leaks the old block. (The "voices will be stopped" sentence that stood here was never implemented.)