Is there a callback when a sound cue has finished playing?

Hi there,

I want to get a callback of some kind when my sound has finished playing. Is there a way I can do that?
I have a sound cue containing a part of dialogue. I want to know when it is finished so I can play the next part of the conversation.


  • Rich

I was looking into that issue as I had that problem with UMG animations. I solved it with the use of delay nodes and some other workarounds, but I don’t exactly like it either :(.

I see. Thanks for the reply. Yes, I could use a delay node.
The issue for me is, I don’t know how long the dialogue is going to be. Is there a way to find out the duration of a sound?

UAudioComponent has an OnAudioFinished delegate that you can hook an event to.

This is the way to do it - the trouble is that it isn’t easy to use from within Blueprint. I used a custom component to manage audio components, bind the delegate and trigger a blueprint event within that class (I’d share the code, but it’s very specific to the project I’m working on, so not really that useful to anyone else).

Handling it through audio components isn’t a bad way of doing it though. I’d avoid the ‘PlaySound’ nodes that are available by default if you’re going to want a callback when the audio is complete.

Why is this not easy to use? Why have the bp wich plays the sound in the same bp you can handle the OnEndPlay (or whatever you want to call it)

Thahts one way to deal asynchronous stuff

I did say handling it through audio components isn’t a bad way of doing it. The issue occurs when you’re doing it from somewhere like the Level Blueprint, where you’re normally expected to use the static gameplay functions rather than components. Whilst you can add an audio component to the level blueprint, or spawn them as and when you need, it’s not ideal - hence why I created a class to manage that for me (because this project contains a lot of level specific dialogue).

ah i see well yes in that case a maybe playback actor would make sense. you would still be able to rerebind the finished event to your maybe level blueprint or whatever :smiley: