PositionalAudio breaks in webxr when moving the user
See original GitHub issueAdding THREE.PositionalAudio to a mesh inside a group (Object3D or Group) alongside the user (camera) works as expected, but if the group is then moved the audio breaks.
To Reproduce
Steps to reproduce the behavior:
- create a container to hold the “vehicle”
- create and add a webxr “user” to the container
- create an AudioListener and add it to the camera
- create and add a PositionalAudio to the container
- move the container “vehicle”
Code
let carContainer = new THREE.Object3D();
scene.add(carContainer);
// create a "user" so that the webxr camera moves with the carContainer
let user = new THREE.Group();
carContainer.add(user);
user.add( camera );
// create an AudioListener and add it to the camera
const listener = new THREE.AudioListener();
camera.add( listener );
function tick() {
carContainer.position.z += 0.01;
}
Live example
(for some reason the fiddle doesn’t show the VRButton button. I don’t use jsfiddle much sorry…) https://jsfiddle.net/mayamoss/zgj5cvpk/90/
Expected behavior
Audio follows the user in local(sic) space.
Platform:
- Device: Oculus Quest 2
- Browser: Chrome
- Three.js version: dev
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Positional audio stuttering (Using Omnitone & Resonance ...
Here are some issues I believe could be linked with mine : PositionalAudio breaks in webxr when moving the user · Issue #22884...
Read more >Web audio spatialization basics - Web APIs - MDN Web Docs
When we move the boombox, the sound it produces changes accordingly, panning as it moves to the left or right of the room,...
Read more >The Design of an Experiment to Evaluate the Effect of Spatial ...
The experiment uses an immersive, web-based platform exploiting the WebXR application programming interface, and built using Three.js and ...
Read more >Audio | Babylon.js Documentation
So, to use our sound engine, you need to use a Web Audio compatible browser. Still, if you're using it on not compatible...
Read more >Bang on A (Virtual) Can: A Primer on A-Frame Audio
This means we get things like positional audio, volume control and audio playback out of the box, as soon as we use an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
can confirm apply #22362 to r135 fixed it
I don’t know what I’m doing wrong but it’s still glitching (crackling) for me when I move the container even with r135 + #22362… I’ll simplify my example to try and get to the bottom of it and report back…