Skip to content

Rotating the AudioListener flips stereo channels #31048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
pekeler opened this issue May 5, 2025 · 1 comment
Open

Rotating the AudioListener flips stereo channels #31048

pekeler opened this issue May 5, 2025 · 1 comment

Comments

@pekeler
Copy link

pekeler commented May 5, 2025

Description

When a listener is rotated around its x-axis, PositionalAudio from its right side comes out of the left speaker.

A rotational angle between -pi/2 and +pi/2 is fine. Other angles flip the left/right audio.

Reproduction steps

  1. AudioListener at 0, 0, 0
  2. PositionalAudio at 1, 0, 0, i.e. on the right side
  3. play audio and confirm sound comes from right speaker
  4. rotate the AudioListener around x-axis by PI
  5. notice how the sound comes from the left speaker now

Code

const listener = new THREE.AudioListener();
camera.add(listener);
listener.rotation.x = Math.PI;

const audio = new THREE.PositionalAudio(listener);
audio.setLoop(true);
audio.position.set(1, 0, 0);

Live example

jsfiddle

Screenshots

No response

Version

0.176.0

Device

Desktop

Browser

Chrome

OS

MacOS

@pekeler
Copy link
Author

pekeler commented May 5, 2025

Rotating the listener around its z-axis is also producing an unexpected result: the sound keeps coming from the right speaker regardless of rotation angle.

Rotating the listener around its y-axis behaves exactly as I'd expect: the sound is moving between left and right speaker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant