crashing when switch music type
Ok, in my game I have so you can select a mid or wav file to play as music. For some reason if I open a mid, another mid and a wav it crashes. I'm using the Windows API and fmod to play my music.
Is there anything wrong with my method of accomplishing things?
In my program I have an integer to track whether the current file is a mid or wav and then in my Windows procdure I use the approiate functions to the play the right type music.
#define MUSIC_MID 0
#define MUSIC_WAV 1
int music_type = 0;
musicType = MUSIC_WAV;
wav_music = FSOUND_Sample_Load(2,szFileName,FSOUND_LOOP_NORMAL, 0, 0);
musicType = MUSIC_MID;
music = FMUSIC_LoadSong(szFileName);