FMOD Studio 1.08.00 (build 73609) 64 bit
Visual Studio Community 2015 - C++
The example projects are all up and running fine and I have used the code from them to start implementing my own.
I have an existing project that I am trying to integrate FMOD into. I am loading a lot of assets from different directories and I notice that if I do not leave the current working directory set to the location where my FMOD banks are being loaded from, when a looping event reaches the end of its loop region, it will simply stop playing. The play state when I query that event ( getPlaybackState()) it still states that it is running but the audio has clearly stopped.
I can’t even seem to trigger the event again until the current working directory points back to the directory that contains the banks.
Every FMOD call is wrapped in ERRCHECK() (copied from examples) and I don’t see a single error being returned at ANY point.
What is going on?
I could maybe understand if an event couldnt be triggered if the current working directory wasnt pointing to the resource but a) the resource should already be loaded into memory from system->loadBankFile(), shouldnt it? and b) since it is already playing, why would it STOP looping just because the current working directory has changed?
I’ve been googling all morning and don’t seem to have found anyone having a similar problem. Am I missing something basic?
EDIT: I made a change to the simple_event example - adding a _chdir() call to a location other than the directory which contains the banks. When the current working dir changes, the looping ambience events will no longer fire, although the explosion sound will. The main difference appears to be only that the instance for the looping sound is only created once (and changing the working directory seems to cause it to fail subsequently) and the explosion instance is created / released each time it is fired (but this works regardless if the current working directory has been changed or not)
This behaviour seems completely bizarre to me. HALP!?
However, _chdir does one more thing: it updates the current directory
of the current drive, stored in an environment variable. This is
needed, as the remark in _tchdir states, because “other functions
(fullpath, spawn, etc) need them to be set”.
This suggests to me not only that FMOD is using the environment variable of the current working dir rather than storing the full path of the banks, but that is not actually loading the contents into memory with loadBankFile()?
I am not loading asynch, so why wouldnt it?