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 :
- PositionalAudio breaks in webxr when moving the user · Issue #22884 · mrdoob/three.js · GitHub
- PositionalAudio: Stuttering with WebXR when close to the audio's origin. · Issue #20920 · mrdoob/three.js · GitHub
- Sound crackling with a html video element · Issue #93 · GoogleChrome/omnitone · GitHub (Omnitone)
Please tell me if you need any more informations!