Search code examples
iphonefmod

Wait for event to play


How can I make sure an event finish playing even though I move around the listener in the 3D world at the same time. I only want to play the event at certain time with the same listener position as when the event started playing. Other event sounds needs to know where the listener is so I need to update the listener position. But I don't want the already started event sound to be effected...


Solution

  • You can register a callback with events so you know when they have finished. Event::setCallback and FMOD_EVENT_CALLBACKTYPE_EVENTFINISHED.

    Perhaps you should consider keeping the listener stationary and only moving the events, that way once you start an event it will keep playing at the same position (unless you move it). It's hard to say without knowing exactly what you are trying to achieve.