PlaySqueak is called during a timeline, which is ok, because it checks if the audio is already playing and only starts it if not.
Stop squeak is called when the timeline stops.
Usually works fine, but… Under certain circumstances, if I walk up to the door and away again repeatedly, so I trigger the Play and Reverse pins on the timeline a lot in some way, I end up with the sound playing indefinitely.
It wont stop even if I manually call the stop event.
in stop squeak you just stop the sound but it still exists and its not removed so is valid may return something you dont expect (doesn’t really have something to do with logic but fixing this will be better).if I was doing this i would do it this way:
add a sound component to door BP and in settings i feed a sound and i start and stop based on event generated like this.
Have you tried to use a game limiter(a gate with a delay), it should limit the player from spawning thousands of sounds and fixing the problem. Again this doesn’t really fix the main issue but if you can’t replicate the problem after that then there is no problem. ¯\(ツ)/¯
So, strangely, it’s not to do with playing a sound on the timeline, it’s something to do with the fact that I use PlaySoundAtLocation to play the final ‘door closed’ sound.
And what it’s doing is playing the last second of ‘squeak’ audio, followed by one of the random door close sounds, repeatedly. Even though the timeline isn’t running!
And… he shoot, he scores, a home goal. The door close sound was a sound cue with a random node in it. One of the waves being played, sometimes, by that random node had all the door close sounds in it…
How embarrasing.
That’s why it’s always so good to use the phrase “I think it’s a bug”, because you know 10 seconds later, you’ll find out it’s your fault…
Hello!
i was given the following advice at the UNREAL DISCORD by Vik, thanks so much:
you can use these nodes and set the volume to zero. This will, against the common sense,
not mute them but quit them. When you put them above 0.01 again, they will restart.
In case anyone is still stuck on not being able to stop a sound cue, here’s what I did:
Place the speaker it will play from in a separate BP within the level. For me, I have an “Enter Level” BP that I use to do opening cutscenes and what not.
Now within the door BP (Or whatever object BP you want to start and stop sound with), use the blueprint node “Get Actor of Class” and select your “Enter Level” BP in the dropdown menu.
Now, from the “Get Actor of Class” node, drag out that speaker component, and from that, drag out again and use the “Stop” Node.
***You can also use “Play” to begin sound, or “Fade In” and “Fade Out” nodes for a little flair.
Now you should be able to start and stop any audio.
Why this works? I have no idea, but it took me way to long to figure it out.