Functions | |
| u8 | audioInit (void) |
| Initialize the audio system. | |
| u8 | audioIsReady (void) |
| Check if audio system is ready. | |
| u8 audioInit | ( | void | ) |
Initialize the audio system.
Uploads the SPC700 driver (built into the lib as audio_driver_blob) through the IPL boot-ROM protocol and starts it, then verifies the command channel with a PING. Call once during game initialization; check audioIsReady() afterwards.
Return codes of the functions that send a command (volume, pitch, envelope, key on / off, echo taps): a command is sent and the function returns at once; the driver's acknowledgement is awaited by the NEXT command, before it writes. So AUDIO_OK means "sent", and AUDIO_ERR_TIMEOUT from one of these functions means the command BEFORE it was never acknowledged (the one just asked for was then not sent). Loading a sample, audioSetEcho() and the functions that read a state back wait for their own acknowledgement, as before.
| u8 audioIsReady | ( | void | ) |
Check if audio system is ready.
audioInit() blocks until the driver answers, so there is no "still initialising" state to poll: 0 after audioInit() means the SPC700 driver never answered (and every audio call is then a no-op).