Sign in to follow this  
ajm113

"No Errors" WTH? - FMOD

Recommended Posts

ajm113    355
======================================== EDIT: I realized I posted in the wrong area can a moderator or Admin move this thread and delete this small edit message. -Sorry ======================================== Ok I am trying to create a game that has music playing that are in a mp3 format and for some reason FMOD keeps telling me their are no errors and closes my program. Here is the code: [code] FMUSIC_MODULE *mod = NULL; //I was playing around with this. FSOUND_SAMPLE* handle; FSOUND_Init (44100, 32, 0); if (FSOUND_GetVersion() < FMOD_VERSION) { //printf("Error : You are using the wrong DLL version! You should be using FMOD %.02f\n", FMOD_VERSION); MessageBox(NULL, "You are using the wrong DLL version!\nYou should be using FMOD 2.0", "War Land FMOD Error",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST); exit(1); } // init if (!FSOUND_Init(44100, 64, 0)) { //MessageBox(NULL, "%s\n", FMOD_ErrorString(FSOUND_GetError())); MessageBox(NULL, FMOD_ErrorString(FSOUND_GetError()), "War Land FMOD Error!",MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST); exit(1); } // load song srand((unsigned)time(0)); int random_integer2; for(int index=0; index<3; index++){ random_integer2 = (rand()%3)+1; if(random_integer2 == 1) { handle=FSOUND_Sample_Load (0,"Base/Sounds/Mandelgroove.mp3",0,0,0); }else if(random_integer2 == 2) { handle=FSOUND_Sample_Load (0,"Base/Sounds/Utne_Wire_Man.mp3",0,0,0); }else if(random_integer2 == 3) { handle=FSOUND_Sample_Load(0,"Base/Sounds/Above.mp3",0,0,0); }else{ handle=FSOUND_Sample_Load(0,"Base/Sounds/Above.mp3",0,0,0); } if (!mod) { MessageBox(NULL,FMOD_ErrorString(FSOUND_GetError()), "War Land FMOD Error!", MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST); exit(1); } // play song FSOUND_PlaySound (0,handle); [code] Can someone tell me whats going on? I am using OpenGL and used this code in the int main area. I did read this article for my problem A Quick Guide to FMOD

Share this post


Link to post
Share on other sites
froz    122
Quote:
for some reason FMOD keeps telling me their are no errors and closes my program


hint:

FMUSIC_MODULE *mod = NULL;
...
if (!mod) { // print error status and exit }

^ mod is still NULL when you get here since you never change it in your code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this