I think I already know the answer to this, but I wanted to check just in case…
Right now my sound layer for scripts allows them to load a sound by filename, and get an object that represents its FMod handle.
When I port to FMod Ex, I was thinking of changing my system so that each time you Play a sound, the engine gives you a Channel object, or something like that, which represents that instance of the sound. I figure this is pretty plausible since you have virtual channels now, so that a script could load up some looping sounds, play them, and keep the Channel objects around and fade them in and out as the player moves around, to simulate panning based on listener position or whatever.
However, I’m unsure about the actual nature of the FMOD_CHANNEL that I get after playing a sound. Is it a unique object that only stays around until the sound is done playing, or does it actually refer to a specific, allocated channel? If it only stays around until the sound is done playing, then I’ll have to reconsider this design, since you could end up with a script messing with a channel after it’s no longer playing anything. I’m assuming that the FMOD_CHANNELs point to actual virtual channels, though, so those objects could be reused or kept as long as needed.
Hopefully it’s clear what I’m asking… ^_^
- Janus asked 12 years ago
- You must login to post comments