Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | giraffupus |
Can anyone help with this? I have a project with multiple audioStreamPlayer2D objects for sound effects in a scene. I just added a new audioStreamPlayer2D object intended for use as background music and found the problem mentioned above.
To test to see if it was a problem in my code I just made an ultrasimple new project that is one scene, a root Node2D node, and two audioStreamPlayer2D children. I loaded in the background music to the first player and a quick punch noise for the second player. I attached the following script to the root node.
extends Node2D
func _ready():
$AudioStreamPlayer.play()
func _process(delta):
if Input.is_action_just_pressed(“ui_accept”):
$AudioStreamPlayer2.play()
This is the entire project and I have the same problem. The music plays at one volume as long as I don’t press spacebar and then the moment I do I hear the punch noise and the background music gets and stays dramatically softer, at least -10db. After a few seconds it seems to slowly begin growing back to its original volume but as soon as I make another noise it drops again.
Is this expected behavior? How can I get around the issue? Thanks for any help.