In designer, I set “step” sound’s loop mode is Oneshot.
PlayEvent( FMOD::Event * soundEvent )
if( soundEvent == NULL )
EVENT_STATE state; soundEvent->getState( &state ) ) if( state == EVENT_STATE_READY ) soundEvent->start();
Press ‘W’ key, first call this function, state = 1, I can heard sound.
Press ‘W’ again, second call function, no sound. Check state, it equals to 9. But in Event_State, there are only value 1, 2, 4, and 8.
And if I delect this: ” if( state == EVENT_STATE_READY )”, no state check and just start event. I can’t hear sound either.
- Sam asked 12 years ago
Depends on your usage :
If you call Event::start() on the same event instance then you’ll hear that event instance restart.
If you have the event property "Max playbacks" set to > 1 then you can call EventGroup::getEvent() and then Event::start() which will spawn a new instance of the event each time i.e. you’ll hear them all overlapping/playing at once.
If "Max playbacks" == 3, for example, and you’ve already got 3 instances playing then when you call EventGroup::getEvent a 4th time then one of the playing event instances may be stolen depending on the event "Max playbacks behavior".
Thanks Andrew, so my understanding is that it’s okay for example to store 4 Event pointers to the same sound (e.g. 4 separate instances of the same beeping sound with a single getEvent call for each) and expect the Event pointer to always remain valid (the same) and playable as long as the "Max playbacks" is at least 4 in the Event and "Maximum spawned sounds" is at least 4 in the Sound definition without any instance stealing going on?
Please login first to submit.