0 votes

I have a simple scene (Node2D) with an AudioStreamPlayer2D, with an audio file (ogg) that has a sound than pans from left channel to right channel.

In the _ready() function of the Node2D, I call play on the AudioStreamPlayer2D.

In the godot editor, if I check the "playing" field in the node inspector of the AudioStream I can hear the sound. it plays properly through both channels.

But, when I test play the scene, I only get sound on the left channel.

Is there some feature I need to enable or change to get stereo output on played scenes?

asked Jun 2 in Engine by Allen Kennedy Jr. (70 points)
edited Jun 2 by Allen Kennedy Jr.

I re-exported the sound with Audacity as a WAV file. Same results. Stereo sound in the editor, but left channel only when testing the scene

1 Answer

+1 vote
Best answer

when using AudioStreamPlayer2D ,the audio output changes according to the AudioStreamPlayer2D node's position according to the camera's position.
for example, if you put the AudioStreamPlayer2D in the player's scene tree, and during the game- the player's position is to the left of the camera's position- you will get stronger sound on the left channel than the right. And so is the opposite.
Are you sure you don't want to use AudioStreamPlayer instead?
This way you will get the same sound from both sides no matter what.

(or you could just change the camera's position according to where your AudioStreamPlayer2D is in the scene)

I hope you will find this helpful :)

answered Jun 2 by drorya (144 points)
selected Jun 2 by Allen Kennedy Jr.

That was the answer! AudioStreamPlayer instead of AudioStreamPlayer2D

What tricked me was the naming convention... most everything in Godot is by default 3D unless specified as 2D such as Area which is 3d, while Area2Dis for 2D use and Camera which again is 3D, while Camera2D is for 2D use. So naturally I thought AudioStreamPlayer was for 3D

Godot sets up a precedent with a naming convention and then changes it when it comes to the AudioStreamPlayer... where there are separate 2D, 3D, and 1D versions.

I agree, it's very confusing. I'm glad this was the answer that you were looking for! :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.