I’m still trying to get accustomed to how FMOD Ex exactly works. One particular odd thing I’m running into is that I’m running out free channels when I try to play sounds, and I think the new sounds are just becoming virtualized.
This is how I was creating the sound:
[code:aci2vjvg]system->createSound(filename, FMOD_HARDWARE | FMOD_LOOP_OFF | FMOD_2D, NULL, &sample);[/code:aci2vjvg]
And I play it with:
[code:aci2vjvg]system->playSound(FMOD_CHANNEL_FREE, sample, true, &channel);
I logged the channels playing, and it never drops, even when the sounds on the channels are completed. Is this a bug, or (more likely) my failure to realize something about channel allocation? Your help in resolving this is appreciated since it’s hard to make a game if you can only play a few sounds and then all new sounds are virtualized.
EDIT: After 20 channels are active, no more sounds are audible, despite my max channel setting being 64. If I lower the max channel count to match my apparently crappy hardware, it can play repeated sounds fine. But it never drops below the max channel count, which is bad… D:
EDIT 2: Oh yeah, and software sound works fine, but once again, the active channel count never drops.
EDIT 3: Tried setting max channels in system->init() to the number of 2D channels from getHardwareChannels(). but that didn’t exactly work either.
EDIT 4: I… [b:aci2vjvg]forgot to call system->update(); in my main loop[/b:aci2vjvg]. Argh I’m a failure. Disregard this entire post, I suppose.
- Overkill asked 8 years ago