Error load file with FMOD... "sometimes"

Started by
1 comment, last by Tingle 13 years, 9 months ago
Might be the wrong section but considering my app is mainly DX...

Anyway, the thing is, Im trying to play a sound file using FMOD.
If I run my application over Debug > Start new instance (VS 2010) then I the sound file is played.
But if I run my applicaiton from the compiled .exe. It wont play...

Ive tried using the full path name, that doesnt work either.

Meaning that the pathing is wrong somehow, but then again not?
Where is the differnce in running my app over the debug instance or normal?


Anyone know why this is happening?

[Edited by - Tingle on July 14, 2010 6:30:48 PM]
Advertisement
Well... you need to narrow it down a tiny bit.
What part doesn't work. Does FMod actually not play the file? or does it not find the file?
launching inside VS, VS gives your app a different working directory than if you launch it from the .exe through windows explorer, so that can explain it not finding the file.

The other, slim chance is that sometimes buffer-overrun type bugs will only show up when the debugger isn't attached. If fmod did find the file, but it isn't playing, you can launch VS and "attach to process" your debugger to find out what is different.

well if I run the file normaly (where the sound is not playing), fmod returns the error, "FMOD_ERR_FILE_NOTFOUND" but if I run it with the debug->start new instance. then it does run and returns 0 = FMOD_OK.

And ill say it again: if running my app through VS, it DOES find the file.


Edit:

okay, fixed it. FMOD "streams" files, meaning it opens the file and keeps it open. The problem is that the path to the file also needs to stay open, by making my path variable into a static one fixed my problem. It seems that runningi t on VS automaticly keeps single variables created inside functions alive somehow, but running the .exe by itsself doesnt support that.

[Edited by - Tingle on July 14, 2010 7:03:19 PM]

This topic is closed to new replies.

Advertisement