AudioStreamPlayer2D audio softens when other sounds play

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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.

:bust_in_silhouette: Reply From: giraffupus

So I did some reading about audio buses and it seems like that is my problem. Everything was sent to the master bus and when the sound effect came through I think it was louder than the music so the master bus dynamically modified itself so the sound effect was the new 0db, thus making the music sound softer. I seem to have fixed the issue in the simple project I created by making two new buses, one for sound effects and one for music, and turning down the db on the sound effect bus.

Now for the task of going through and editing all the audioplayers in my much larger project.