I can easily get Tone.js to generate a tone within a Three.js world, simply by calling, e.g., oscillator = new Tone.Oscillator(440, "sine").toMaster();
, but I can't work out how to connect that tone to an AudioListener in the Three.js world to make it be a positional sound. Does anybody know how to do this?
Using the oscillator built into Three.js, it works perfectly as per the Three.js audio-sandbox example, where it uses oscillator = listener.context.createOscillator();
so I assume this proves I need to connect the Tone.js output to the AudioContext of the listener, but I just can't figure out how to do that, and nor can I find anything on the web about it. Any examples I can find simply use the toMaster()
approach as above, so the sounds are not positional.
Any help most appreciated!