This is the first I’ve heard of such a feature request and I think it’s a pretty good one. Good news is that it’s probably easy to support that since we do support pausing/unpausing of audio in general (when you pause the game, non-UI sounds will pause).
If you are a programmer, or have access to a programmer, and you don’t want to wait for us to add the feature, I’d go about it this way:
- Add a new blueprint callable function to the audio component class (“Pause”)
note: this would really only be supportable using audio components since you’ll need a handle to the sound to pause a playing sound
- Create a new bool variable on an audio component (bPaused) so that child sounds can query it’s parent audio component if it paused.
- In the active sound (FActiveSound) update loop, query its parent audio component (if it exists, not all playing sounds have audio components) about whether it is paused
- If the paused, then call “Pause” on the active sound’s FSoundSource object(s).
There’s a couple of edge cases or questions you might have to work through:
How does pausing an individual sound interact with the general game-pausing feature?
Do you support pausing any type of sound (including UI-sounds)?
What happens if the sound doesn’t succeed in playing in the first place (due to voice-prioritization/concurrency resolution)?
I’ll make a jira task for this so that we don’t forget about it.