All sound effects cease to play again after a specific sound plays multiple times

Godot Version

4.6

Question

This has been driving me crazy for ages and I've not found any solution. Simply put, I have a mechanic in my 2d game where you must shake the mouse side to side to "shake off" an enemy, and to do this I have 2 rectangles on either side of the screen that check if the mouse is over them and adds to a "total mash count" variable. It plays a sound whenever the mouse enters one of them (only once and so does the variable increment) per "mouse enter". For some reason, after this encounter stops, all my other sound effects never play again like closing a door or entering a locker. It's a very small simple game.I’ve tried messing with busses, polyphony limit, etc. Nothing works.

You need to share your code snippets, otherwise it’s essentially impossible for us to find the problem.

1 Like
func _on_left_door_button_button_down() → void:
soundplayer.stream = load(“res://Sounds/doorclose.wav”)
soundplayer.play()
leftDoor = true
officeStates()
print("left door is " , leftDoor)

This is my code for handling the door and its sound. I use the same audiostream for both the door and locker shutting/entering sound

func _on_mash_left_mouse_entered() → void:
if snakeAppeared and not dead:
mashSound.play()
snakeMashCount += 1
print(snakeMashCount)

This is my code for handling one of the mashing rectangles. It’s the same for the one on the right. Again, after this encounter finishes, all other sounds like the door and locker are basically muted and never play again unless i restart the game. The mashing sound is on its own bus.

Please format the code properly as preformatted text with triple backtick ``` at the beginning and end of the snippet. Otherwise, as you can see, it flattens and is hard to read.

I have done so. I am new here and to code forums so apologies.

Are soundplayer and mashSound referencing the same audio stream player? Even if so .play shouldn’t prevent further plays.

Are there any effects on your audio bus?
Do you pause the game?
Any other code affecting audio stream players, or audio buses?

Soundplayer and mash sound are 2 different stream players. The sound player is connected to a bus with reverb effect. Again to clarify, after the mashing sequence concludes I no longer hear my door and locker sounds. The code still executes (like the doors shutting/opening) but the sound just stops playing. The game does not pause either. And again simply playing the sounds for the door, locker and mashing feedback is the only code for them.

Might be worth uploading the project somewhere if it’s small enough, not much to go on at the moment.

How are you implementing this effect?

Do you still have the issue if you disconnect the effect from the sound player?