0
0

We’re giving our sound designer control over as much as possible in our engine by using only events. However, given only the FMOD::Event interface, I haven’t found a way to control or detect when the sound is looping, which naturally poses problems when in-game objects are destroyed but cannot properly cleanup their sounds. For this particular instance we’d like to allow one-off sounds to play to completion when their object owner is destroyed, but fade-stop if the event is looping. What would be the best way to accomplish this?

  • You must to post comments
0
0

Hi there,
The only way I would think of accomplishing this is to use fade out time in the event properties. If you have a bunch of events already you could use a template and apply it.

‘Fadeout time’ in the event properties will do it, and when you call Event::stop it will fade the sound out instead of killing it dead.
Maybe all your events, including the oneshots could use the same fade time? (if they are short sounds you wouldnt even notice the start of the fade, and maybe you dont want 10 second one shots continuing this long anyway)

For when you really do want to stop these events dead you just call Event::stop(true)

  • You must to post comments
0
0

[quote="brussell":8vhjtm8e]We’re giving our sound designer control over as much as possible in our engine by using only events. However, given only the FMOD::Event interface, I haven’t found a way to control or detect when the sound is looping, which naturally poses problems when in-game objects are destroyed but cannot properly cleanup their sounds. For this particular instance we’d like to allow one-off sounds to play to completion when their object owner is destroyed, but fade-stop if the event is looping. What would be the best way to accomplish this?[/quote:8vhjtm8e]

you can use SetUserData to set any properties you deem fit/useful for you in your program…

I set the user data to a structure pointer that holds all kinds of extra information… One of the structure element (eg isLooped) could be set to true if the sound is looped.

  • You must to post comments
0
0

I may well resort to setting userdata, but I’m also curious about the fadeout time solution: if, like I mentioned, I want to only fade-stop looping sounds and allow one-shots to play to completion, how would I differentiate in code?

  • You must to post comments
0
0

I’ve just been informed by my sound designer that we can use EventParameter::KeyOff to signal the end of looping sounds, and author them to have parameters when they need a point to end their loop. Is this a recommended solution?

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.