#include static void load_sounds(void); static Mix_Chunk* sounds[2]; void init_sounds(void) { memset(sounds, 0, sizeof(Mix_Chunk *) * 2); load_sounds(); } void play_sound(int id, int channel) { Mix_PlayChannel(channel, sounds[id], 0); } static void load_sounds(void) { sounds[0] = Mix_LoadWAV("sound/beep_lo.wav"); sounds[1] = Mix_LoadWAV("sound/beep_hi.wav"); }