EtherealEngine / etherealengine

iR Engine - Bringing us together on the open social spatial web. 🤖 🚀 👓 🕹ī¸ 🧑đŸŋ‍🚀
https://etherealengine.org
Other
706 stars 248 forks source link

Replace threejs Audio Listener #5696

Closed speigg closed 2 years ago

speigg commented 2 years ago

The threejs audio listener somehow causes the web audio api to hog the CPU, gradually becoming worse over time until the frame rate becomes unbearable. Let's try a different spatial audio solution. This seems like a viable alternative:

https://howlerjs.com

image

speigg commented 2 years ago

Relevant links

https://discourse.threejs.org/t/audiolistener-linearramptovalueattime-execution-grows-over-time-to-eventually-dominate-the-frame-time/10264

https://github.com/mrdoob/three.js/issues/17705

https://github.com/mrdoob/three.js/issues/15344

This person solved the problem by using howler.js instead of the three.js audio listener https://discourse.threejs.org/t/reason-for-fps-slowdown/28129/4

speigg commented 2 years ago

I can only reproduce this issue in a local dev environment