I have a project that has narration playing via the sequencer in the scene. I want to be able to trigger another audio cue via a triggerbox in the same scene. However, I don’t want the voice in the narration to overlap that cue or vice versa. How can I make sure that the audio I want to trigger only triggers when the narrator is not speaking? or, be able to pause the narration when the cue is triggered, and then resume it afterwards?
It really depends how you’re making the sounds, but assuming you’re using ‘play sound’, you use ‘spawn sound’ nodes instead. That way, you get a reference to the sound, and you can do a lot more with it, like pause, stop start etc.
As clock was saying depending on how you implemented the sound. If you use spawn sound, use the reference from the blueprint to the call “Pause sound” which can then pause the narrator. If you then wanna continue playing the narrator, you can then call Play Sound and it will continue where it left off with no new args.
Documentation on the entirety of the sound stuff is Audio | Unreal Engine Documentation
You can even check and see if the narrator’s sound object is currently playing, which could help you decide if you pause it or stall other sounds. If you have any specific implementation questions, let us know!
Yeah I thought about that. that works in one of my scenes, that has only one audio clip for narration-- I referenced it in the level blueprint and can pause/start it on a trigger. But other scenes have multiple clips of the narration which are currently spaced out along the timeline in a sequence player. I suppose I could spawn each one with a delay in the scene (instead of the sequencer) so I can reference them in a blueprint, but I’m looking for an alternative because that seems messy to do for every scene.
Oh then one paradigm I’d suggest is a variable that is always set to the current playing narration. So every time you spawn/call a narration sound, you get that reference, pop it in a variable inside your GM, then when that narration is complete, toss the reference. Or if any narration needs to be paused, you can make a generic function to pause whatever sound the variable is referencing.
This basically ensures you can interrupt any narration with any sound by just calling that event, and you can make one that un-pauses it the same way. That will also be scalable as your game gets bigger, you won’t have to write anything new.
Ok thanks, I’ll look into it
If you have any questions about it definitely let me know, and if these answers from clock and I were satisfactory they can be the resolutions for the thread.