mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
103.09k stars 35.42k forks source link

Enhancement suggestion: Web Audio for Three.js #5226

Closed Ovilia closed 10 years ago

Ovilia commented 10 years ago

I would like to merge jWebAudio https://github.com/01org/jWebAudio into Three.js, which is designed to make it easier to use Web Audio. It's fully documented and tested. See more information at 01org.github.com/jWebAudio .

antont commented 10 years ago

surely you can already use jWebAudio or any audio solution together with three.js?

do you mean an integration where three's object3d's could automatically be spatial 3d audio sources etc? and that three would have an audio api in general? i suspect that it can be out of scope for three as a graphics library but am not sure.

i believe @jeromeetienne has done something like that already in his webaudiox.three.js described in https://github.com/jeromeetienne/webaudiox with things like:

var panner  = context.createPanner()
var object3d    = new THREE.Object3D
WebAudiox.PannerSetObject3D(panner, object3d)
Ovilia commented 10 years ago

@antont Thanks for your sharing. Seems to be quite enough with @jeromeetienne 's webaudiox to me. Maybe I can find something else to contribute. =)

mrdoob commented 10 years ago

I'm actually planning on adding a THREE.Audio3D of sorts :)

antont commented 10 years ago

right - i was suspecting you may see three as a wider thing than just graphics .. can be nice and make sense like in game engines where all things are integrated. looking forward to hearing that :)

(btw if you think that also networking could be integrated some day we're interested to at least know as that's what our project is about and we're continuing with it)

mrdoob commented 10 years ago

Networking is too broad I think. Audio3D is handy because it is really part of the 3D scene.

antont commented 10 years ago

+1

perhaps your audio api can still allow for alternative audio playback engines if necessary .. as there seem to be many. don't really know about that. if a single webaudio using three integrated implementation serves everyone, well, i'd just be among the happy users :)

regarding networking, our thing is a separate framework which just uses three and integrates it with the net lib to do scene sync etc .. probably the good way in the future too then, thanks for info.

jeromeetienne commented 10 years ago

@mrdoob can i help ? what are you plan on this THREE.Audio3D api ?

https://github.com/jeromeetienne/webaudiox/blob/master/lib/webaudiox.three.js the code is here and got no dependancy beside three.js

Ovilia commented 10 years ago

@mrdoob jQuery has 3D sound effect ready for use. =) https://github.com/01org/jWebAudio#3d-sound-effect Please tell me if you allows me add this feature into Three.js! :smile:

mrdoob commented 10 years ago

Uhm... I was going to try to implement the code I did for rollercoaster.