I am making a website (https://shubhamsingla807.github.io/portfolio/) and when small balls collide with large balls I want to make some nice sound. like a piono or something. So, far I have no luck. I have tried to just load some external audio and play it when balls collide but that just takes time to load and when balls collide to much create a bad effect. Then i come to know about Tone.js and js inbuilt sound support but I have no idea how to use it. Any need help with how to use Tone.js or any other similar library.
Asked
Active
Viewed 28 times
0
-
This is a little tricky as it is actually a couple of problems wrapped. I’d recommend getting some of the Tone.js examples to work first https://tonejs.github.io/examples/ . Once you’ve done this you should be able to refine the question a little. Looking ahead, be aware that audio will require a user interaction in order to hear it. That means any solution will not simply work on page load. – fdcpp Jun 09 '21 at 07:09
-
thanks for the info. I actually forgot that we need user intraction to start the audio. I guess I just clicked every time I was doing it with multiple audio files. – lovekesh Jun 09 '21 at 07:18