Closed PrNotGood closed 2 years ago
try removing sync()
from the oscillator, that sync's it to the Tone.Transport which is going to change the behavior of start/stop so that it is aligned with the start/stop of the transport. It essentially schedules the start/stop events to the transport. If you want it to respond to a click handler, you should probably remove it.
Thank you, I was sure that I tried it, but apparently not. It seems that now it is working correctly.
Describe the bug
Hi, I'm currently try to implement audio generation with ToneJS on a site developed in Aframe (Networked Aframe to be precise), the basic idea was to create sounds when clicking an entity, which seems to work, but when I apply this same concept to an oscillator, the methods start() and stop() don't seem to work properly (sometimes they doen't seem to activate, resulting in multiple audio overlapped or no audio reproduced). I'm using a panner3d in order to give them positionality, it could easily be that I'm using something incorrectly. I created this looking at the source of the example with the 3d Panner
To Reproduce
Unfortunately I cannot provide a direct editor, though here is the part of my code that gives me problem:
Expected behavior Just reproduce the sound on click and to stop it on the next click
What I've tried It seems to work correctly without all the panner3d, but it kinda defeat the idea of 3d audio, I couldn't find anything online