Skip to content

Rotating the AudioListener flips stereo channels #31048

@pekeler

Description

@pekeler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions