Quick question.. I’m trying to setUserData on an event (Event::setUserData). When I try getting the value back with Event::getUserData, it gives an error "FMOD error! (90) Tried to call a function on a complex event that’s only supported by simple events. ". Now…. is the error right? Cause if that was the case, why would I be able to set it first? Is it just missing the error from the setUserData?
For some reason, I cannot start the event more than once at the same time even though max playback is set to 20. Could that be related? The fmod designer project was made with an old version and then I tried converting those to the latest… Is there a way to debug why playback > 1 doesn’t work?
I tried making a single event myself with the latest fmod designer and I have the same problem (cant play sound multiple time in the same time). And so, I tried using the event player and for some reason, it works well in it… so it seems like there are some settings somewhere that enables the multiple play at the same time.. any ideas which one it is?
I am implementing the create and release callbacks when an event is started… and making sure to use the same instance of sound to prevent using more memory than necessary… could that be the actual issue? We need to create a new sound every time we want multiple instances of one sound to be played at one time?
- machoman asked 5 years ago
Alright… for those who wondered, it seems we need to get a new event everytime we want to play the same event or something similar. For instance, if I want to play two explosion sound, I need to getEvent twice and hit start on both to have the same sound be played twice in the same time.
Can someone confirm that I’m doing it the right way?
[quote:hisa02i9]For instance, if I want to play two explosion sound, I need to getEvent twice and hit start on both to have the same sound be played twice in the same time. Can someone confirm that I’m doing it the right way?[/quote:hisa02i9]
That is correct, getEvent will fetch an instance of an event, you can get many instances of a single event. The maximum number of instances of a given event is determined by the ‘Max Playbacks’ property set inside FMOD Designer. Internally there is a pool of that many event instances and the stealing behaviour is determined by the ‘Max Playbacks Behaviour’ property.
- Guest answered 5 years ago
Ok.. so do I need to release those events or not? In the example, it never releases it. It just get the event (in a group) and then release them all at the end.
Concerning the create/release callbacks, can I load the FMod::Sound and reuse it every time there’s a subsequent create? For instance, I get an event (getEvent) everytime I wanna play a sound and leave it as is (or maybe check its status until it’s done playing and then release it?).. then in the end (in between levels for instance), I release all the sounds and clean the FMOD::Sound with a release on each of those..
Would that work? Cause right now, it seems like I have issues reloading a sound file even though I was able to previously.
Please login first to submit.