mercredi 24 décembre 2014

How do I get a web audio api oscillator to sound more than 6 times

Here's the basic code:


In the html I have a button that calls playInterval.


In the script I have the playInterval script that creates and connects four oscillators, then plays two oscillators together for 1s, waits 0.5 seconds and plays the 2nd two oscillators together for 1s.


The problem is, I can't get the interval pairs to play more than 6 times. I've searched and tried everything I can think of.


I know I shouldn't have the AudioContext in the function - that's why it is being called six+ times, but it doesn't work if I take the AudioContext declaration out of the function.


I know there must be a simple solution for this. Any help would be greatly appreciated.


I can't attach the entire code. stack overflow doesn't like the formatting and I can't see what's wrong with it. It has no syntax errors in NetBeans.


Aucun commentaire:

Enregistrer un commentaire