I have a problem where sounds are not playing in a category that is set to MaxPlaybacks=1 StealMode=JustFail.
These settings work fine for most of the time, except that when two sounds follow one another closely enough, the second one is not heard.
Is there some internal update time where it takes about 0.1 seconds after a sound has finished before the category knows about it and will then let another sound play?
ie: I have two very short test sounds, only a few milliseconds long, and when they play close enough together, like about 100ms then only one plays and the second one shows up as "Fail – max playbacks".
- mattconnolly asked 8 years ago
With Max playback 1 and Just Fail set, any time an event is called while there is already an instance of that event already playing, the second one will not start up, which is what the Just Fail setting does.
If you’re trying to get the second one to play, and kill the first one, set it to Steal Oldest. If you want them both to play, increase the max playback, but I would still set it Steal Oldest in most cases as well, so that the most recently called sound will always play. It depends on the behaviour you’re looking for, of course.
I don’t know how long it takes for EX to release the sound, but this should at least get your sounds playing.
Example: I have two test sounds A and B. each are about 5 milliseconds long. Both have max playbacks = 1 and go throught a category with max playbacks = 1, just fail.
You would think that you can play A and then play B 20 milliseconds later since A would have finished by then.
But it appears to me that I cannot play another sound through the category until about 100 milliseconds AFTER the previous sound has finished.
It seems that even though the A sound has finished, it takes some time for the category to clear so that an B can be played.
In this example, I am not trying to play more than one sound at a time, and max playbacks = 1 is the setting I want.
- mattconnolly answered 8 years ago
I would expect the time between voice taken and voice freed to be directly related to your FMod update rate at run time. So if you update FMod every frame, you would only be able to play a new sound each frame. However, if you’re using spawning to play the sounds, I’m not sure how FMod handles spawned sounds in between frames. I suspect it’s still limited to the FMod update rate/frame rate, will only start on the next frame, or gets culled based on your voice stealing settings. I’ve found using spawning at high rates to have inconsistent results, to the point where I’ve had to use longer audio grains and slower rates to avoid drop outs.
FMod support would certainly be able to speak to these issues better than I would. I’d like to more about how these short and fast samples are handled as well.
You need to either call update() or event->stop() before playing the next event as the event system determines the playing state of all events in the update() call. If you don’t call update() between starting your events, the event system will not be able to register that the first event has stopped, and will prevent you from starting another instance. I presume that the next event plays after the following call to update() which is taking up to 100ms in your code.
- Guest answered 8 years ago
Please login first to submit.