Don't know how to stop an audio event!

Hi everyone!
I’m sorry to bother you with such a noob question but I’ve been working on this all day and I couldn’t find any clues…
So here is the situation : I’m working with FMOD 2 and Unreal 4. I’ve created a Scatterer instrument that triggers with a collision box. When the player goes out of the collision box, I’d like the Scatterer instrument to stop playing…
I’ve tried many things today but I couldn’t find any lead. My very simple blueprint looks like this :

I’ve tried with a boolean too…I’ve changed the Scatterer instrument to a multi-instrument but nothing worked so far!

That must be a really noob question but the truth is that I am a noob!
Could someone tell me what I don’t do right?

Thanks in advance!

Mole

You would want to call stop on the event instance returned by Play Event 2D in this situation, i.e
image

Hi Jeff!
Thank you very much for the reply! Indeed, I learn today that I really need to be careful about the “nature” of what is returned by the function…I’ll be more careful next time!
I learn as well that when an event is played, an “instance” of the event is created and if I want to act on it, I must call the “instances” functions…
So potentially, I could call, let’s say, 3 “Play event 2D function” in the same Blueprint and they would return different instances of the sound…Which I could then manipulate individually…Am I correct?!

One last question : I don’t really understand the Stop function then…When would that be used?

Many thanks again!!

That is correct.

An FMOD Audio Component is a separate, higher level entity to an Event Instance. When you drag in an FMOD Ambient Sound into your scene from the Content Browser for example, you can see in the Details pane that it has an FMOD Audio Component attached:

If you had a reference to that in your blueprint you would call Stop on that. Alternatively you can add an FMOD Audio Component using the Add Audio Component node and manipulate the returned FMOD Audio Component.


Just adding on to this thread cause my event isn’t stopping like expected either
To explain, the yellow nodes are supposed to stop the “Birds” event when the switch is hit. I know the switch is being hit because the Print Text node is triggering. I am pretty sure this is how I’ve always done it, and this thread reinforced that idea, but the audio continues to play after it shouldn’t

The forum isn’t letting me add more than one image since I’m a new user I guess so I can provide an image of FMOD in a reply


An image of the event in FMOD

Hi,

What version of the FMOD integration are you using?

Could you add the Event Instance Is Valid node:
image
To make sure there aren’t issues when trying to interact with the instance.

Could you also set the Logging Level to Log


And let me know if there are any errors in the console?

I have a similar issue. I’ve checked and it is returning true when the event is playing. I’ve been researching this and can’t find anything about it, the sound simply won’t stop playing.

I’ve seen people mentioning setting a trigger condition of “not stopping” to the instrument itself, I tried it and it did nothing.

Thanks!

Hi,

Do you see any errors logged in the console?

Not when the event is meant to be stopping. If I keep retriggering it, it gives me the “LogFMOD: Warning: d:\jk\workspace\Build__2.2__Unreal_Win\core_api\src\fmod_systemi_update.cpp(577) - Channel 0x63600009 Stolen with audibility 0.447047”

Otherwise, no errors.

Hi,

Thanks for the info.

Could you add the Event Instance Is Valid node before the stop node:


To make sure that there isn’t an issue with the instance that is being referenced.

Is there any level loading happening between the event being played and stopped?

Hey, thank you for all your help. First of all, I did what you mentioned, and the Event Instance returned valid. However, I seem to have found a workaround for this issue.
I’m not entirely sure why this is the case, but it seems to be caused by triggering the sound using the “Triggered” node of the Enhanced Input system. Right now I have all my logic for the Action running on triggered, and simply put the sound to start on the “Started” node, and this fixed. Maybe it’s how the action gets processed by triggered that makes it so you can’t interrupt the flow? Maybe it’s another node I had somewhere that was causing issues? Here’s what I have now, and it’s working fine.

But again, I really appreciate your help.

Here’s an image of the full Action’s blueprint, in case you want to have a look and see if you can figure out what was causing the issue (or if someone else runs into a similar issue).

1 Like

Hi,

Thank you for sharing the solution.

I will continue to investigate why this is an issue. If there are any updates I will post them here.