0
0

So, in game, say I have an automatic weapon (uzi) that starts shooting. I want to just start playing a looping uzi fire sound, so I do:

[code:2vf4lcfd]uzi->getSound().play();[/code:2vf4lcfd]

Likewise, if it runs out of ammo or the NPC decides to stop shooting, I stop the sound accordingly:

[code:2vf4lcfd]uzi->getSound().stop();[/code:2vf4lcfd]

The problem is that using the Event class, Event::stop will halt the sound (not streamed) completely before it finishes. Yes, that is the desired effect, but I was wondering if there was a way of setting a sound to stop once the current loop finishes?

Looking over the documentation, I assume this can be done with the Sound class using loop points, but I’m not sure. Ideally this would be something that could be flagged by a sound designer in the designer application, but the events only allow specifying of looping or not. An option like “complete looping” would be great.

If there is a way to do this in code would be just as good (like stopAtEnd or an optional parameter to stop() that waits until the sound finishes first).

Jeff M.

  • You must to post comments
0
0

That’s certainly valid, and I’d love to do it. However, that functionality isn’t available to me through the Event class (or at least if it is I’m not seeing it in the documentation). Perhaps I forgot that point in my original post, though. If this functionality could be made available to the Event class, that would be great.

Thanks,

Jeff M.

  • You must to post comments
0
0

Thanks, Brett.

I’ll wait for the new feature. Hopefully soon, but no immediate rush. :)

Jeff M.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.