Why isn't my playSound() working properly? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why isn't my playSound() working properly?

It works when called in start() but doesn't works elsewhere. I am using web audio api's oscillator to make sound. https://code.sololearn.com/WBOm4adsUrE1/?ref=app

15th Jul 2020, 8:34 AM
Sameer Crestha
Sameer Crestha - avatar
1 Answer
+ 1
you need the time it start playing + duration this.o.stop(audioCtx.currentTime+this.duration)
15th Jul 2020, 10:02 AM
Taste
Taste - avatar