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:
Likewise, if it runs out of ammo or the NPC decides to stop shooting, I stop the sound accordingly:
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).
- jeffm asked 12 years ago
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.
Please login first to submit.