3 ms·
Related fun fact: if you're using THREE.js, you might not know that basic positional audio is supported right in the library. It works with regular <audio> elem
by avaer 9y ago
Related fun fact: if you're using THREE.js, you might not know that basic positional audio is supported right in the library. It works with regular <audio> elements via WebAudio.
https://threejs.org/docs/#api/audio/PositionalAudio https://threejs.org/docs/#api/audio/PositionalAudio
I figure if someone told me this it would have saved me a couple of hours.
- slimsag 9y agoFYI WebAudio[1] has a PannerNode[2] that does exactly this (I only mention in case you thought you might need to manually calculate positional audio without THREE.js) [1] https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_A... [2] https://developer.mozilla.org/en-US/docs/Web/API/PannerNode https://developer.mozilla.org/en-US/docs/Web/API/PannerNode
- avaer 9y agoToday I learned! If you're working with a scene graph you still need to glue your matrices to WebAudio, but I'm consistently amazed at how far you can get without a library in modern browsers.