I’m trying to better understand these two structs.

I was trying to write a debug script call for our game, that, when executed, could loop through all currently playing events and print out their names in a debug console.

We are using fmod Designer (vs. 1.9.5) and fmod ex ( vs. 4.09.08 )

I tried a few different approaches to this.

Not sure if this is the best way, but currently I start with the master category, and for it, and each sub category, call EventCategory::getNumEvents, and loop through the events to see which ones are playing.
(I supposed I could do an equivalent thing with EventGroups)

To loop through, I call EventCategory::getEventByIndex –> I found that I had to call this with the FMOD_EVENT_INFOONLY param otherwise the currently playing sounds were affected, and I was loading all sorts of event data that I didn’t want to.
However, if fetched any given Event in this manner, I could not get any useful information out of Event::getState, as it always returned FMOD_EVENT_STATE_INFOONLY.

So, one question is: how do I get a handle to an event such that I can call Event::getState to see whether it is FMOD_EVENT_STATE_PLAYING?

The next thing I tried was to call Event::getInfo on each Event in each category.
Then I checkd if info.channelsplaying or info.instancesactive was greater than 0.
This sort of worked – I’d be in a state in the game where I knew there were 3 events playing (I could here them), and I could see names of the events outputted to the debug console, however, for all 3, info.instancesactive was 1, while info.channelsplaying was 0.
How can a playing sound (that I can hear) have channelsplaying == 0?

Thanks in advance

  • You must to post comments

We have lots of audio components which point to the fmod_event whenever they are started (or null if the event has not been fired yet), ie, each point source has its own audio component etc.

The fmod_event structure should be valid even if it’s stolen or whatnot.

I guess it depends on if you are using fmod as a direct method of getting sounds out, or are using it as another layer in your audio solution.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.