Positional audio stuttering (Using Omnitone & Resonance Audio SDK Ambisonics libraries)


I’m building a virtual space with 3D audio integration, using the Resonance Audio SDK library (built on top of Omnitone). It is a tool for using Ambisonic audio, therefore providing more precise localization and better quality. I’m having problems with the sound, which is severely stuttering/popping when the listener is moving. It happens when rotating the camera, and when moving the listener, and it gets heavier when you get closer to the objects (which are attached some audio file).

I tried to lower the sample volume, as I thought it could be some clipping, but it doesn’t help. I’ve been struggling with that for days/weeks, I tried with several libraries, decomposed the camera matrix to apply some easing to the position update, but it won’t help. I tried to find some solutions online, I can see some people have the same problem but it’s not a widely known issue.

I’m trying now to ask some help here, because I believe this problem could be linked to the use of Three.js, and not the audio libraries (I’ve tried with 3 different ones). I found a demo project using A-frame online, which had the same problem. But I also found some that didn’t share it… And I know this issue was already addressed, and resolved a few times in the dedicated GitHub for Three.js.

Here is the link to the GitHub repo. I hope someone will be willing to spend some time to help me with some insight, if you have any familiarity with this issue. Thank you anyway if you took the time to read this.

The code : GitHub - polar0/metaverse: This experiment is an example of 3D Audio integration in a virtual space with Blockchain interaction, that could be described as a "metaverse".
You can get to the demo from the ReadMe.

Maybe I can make it easier with some hint on the organization of this repo :

  • The code for audio is in src/World/audio
  • ‘main.js’ only inits the main functions, what should be interesting is in ‘positioned.js’. It’s a very basic setup, with the audio position updated at each frame (you can see it in ‘src/World/World.js’).

I don’t really know what else to try, but I believe some more experienced developers can hint me. If you have any idea of a project making use of spatial audio with such libraries, without this specific issue, please tell me, as I could find some help looking though the code!

For instance, this project makes the same use of 3D Audio, with A-frame, and it working great! But the code is really complex and it spreads across many files… VR music – Trick the Ear

Here are some issues I believe could be linked with mine :

Please tell me if you need any more informations!


To ensure it’s a three.js related issue, it would be important to test the same audio input with another 3D engine like BabylonJS or with plain WebGL/WebXR.

In any event, PositionalAudio breaks in webxr when moving the user · Issue #22884 · mrdoob/three.js · GitHub could be related and I would definitely apply the respective patch (WebXRManager: Fix XRCamera Local Space Behavior by Reverting #21964 by zalo · Pull Request #22362 · mrdoob/three.js · GitHub) if you experience sound glitches in WebXR. However, keep in mind that this issue is only relevant for WebXR. It does not effect non-WebXR apps.

I’ve applied this patch, I still have the issue. I will try with other engines. But using other sounds (from this demo it’s works better. I guess the sound files are part of the problem, but it makes it even weirder…

I believe it might be an issue due to the refresh rate of browsers (10-15ms), since now it happens only when rotating the camera fast enough.

Thanks for your advice. :slight_smile: