Verified that audio has been initialized before playing sounds or ticking audio.
This commit is contained in:
@@ -144,6 +144,11 @@ SM64_LIB_FN void sm64_audio_init( uint8_t *rom ) {
|
||||
#define SAMPLES_LOW 528
|
||||
|
||||
extern SM64_LIB_FN uint32_t sm64_audio_tick( uint32_t numQueuedSamples, uint32_t numDesiredSamples, int16_t *audio_buffer ) {
|
||||
if ( !is_audio_initialized ) {
|
||||
DEBUG_PRINT("Attempted to tick audio, but sm64_audio_init() has not been called yet.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
update_game_sound();
|
||||
|
||||
u32 num_audio_samples = numQueuedSamples < numDesiredSamples ? SAMPLES_HIGH : SAMPLES_LOW;
|
||||
|
||||
Reference in New Issue
Block a user