Way to get what assets are being played within an fmod event?


(James Langford) #1

I have an event with a multi sound container and would like to know what asset(s) are being triggered when the event is played. Is there a way of getting this?

Thanks


(リチャード清水) #2

Hi James,

You can use the FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED callback to find out which assets are being played:

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_STUDIO_EVENT_CALLBACK.html#/

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_STUDIO_EVENT_CALLBACK_TYPE.html

Thanks,
Richard


(Ron Gilbert) #3

Yes, you can loop through all the channels and get their assets.

FMOD_System_GetChannel(_fmod_system, index, &channel);
FMOD_Channel_IsPlaying(channel, &info.playing);
FMOD_Channel_GetCurrentSound(channel, &sound);
FMOD_Sound_GetName(sound, &info.name[0], sizeof(info.name));

If a multi-sound is playing, it will tell you the asset.

You have to use the low-level API calls, but they work fine if you’re using the studio API.