/* sound.c - Sound stuff for gradient wars

   By James Stanley

   No license - Use as you wish */

#include "sound.h"

SAMPLE *shoot;
SAMPLE *enemyshoot;
SAMPLE *newenemy;
SAMPLE *power;

#ifndef NO_MUSIC
SAMPLE *music[TRACKS];
int music_voice;
#endif

void load_sounds(void) {
  shoot = load_sample("sounds/shoot.wav");
  enemyshoot = load_sample("sounds/enemyshoot.wav");
  newenemy = load_sample("sounds/newenemy.wav");
  power = load_sample("sounds/powerup.wav");
  
#ifndef NO_MUSIC
  music[0] = alogg_load_ogg("music/mus1.ogg");
  music_voice = allocate_voice(music[rand()%TRACKS]);
  voice_start(music_voice);
#endif
}
