PlaySound2D triggering more than once.

I have a Custom Event in BP (that is triggered from C++ using Broadcast from a Dynamic Multicast Delegate).
The event in BP has a PlayAnimation and a PlaySound2D. Sometimes (not all the time) the sound played is VERY loud, as if it has been played 2-4 times at once but then other times it sounds as expected.

Are multicast events safe for this?
What would trigger the event multiple times?
Anyone seen this?

I tried lowering the Audio Concurrency to 1 for these PlaySound2D events to see what effect it had and it “fixed” the “loud sound” bug, but sounds also started cutting off sounds and so it wasn’t satisfactory.

Thanks,

Hi,

I’ve not gone as deep as that just yet but I have logged everytime I broadcast and verified that it’s definitely only being done once.

I will try a breakpoint in PlaySound2D but it is tricky since it will hit it a lot and the bug doesn’t always happen.

Try using the PrintString node instead of debugging if you don’t want it to stop everytime then :wink: let me know how it goes!

Have you confirmed that the PlaySound2D is actually being called multiple times, with PrintString nodes for instance?

I’d say if it does, that it is likely that the C++ event is being broadcast more than once. Have you checked that too? Again with AddOnScreenDebugMessages, for instance :slight_smile:

I have found something. Although I broadcast only once the delegate finds two functions to invoke (both PlaySound2d with the same sfx) so I must have the created UI twice - somehow… I wil investigate further, thanks.

Found it. I was creating the Widget twice, doh!

Thanks for the help, breakpointing in PlaySound helped track it down.