Skip to content

Commit f423ee4

Browse files
committed
added checks to avoid multiple start calls
1 parent a5d6573 commit f423ee4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/signal.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ define(function (require) {
3131
* @example
3232
* <div><code>
3333
* let carrier, modulator;
34+
* let hasStarted = false;
3435
*
3536
* function setup() {
3637
* let cnv = createCanvas(100, 100);
@@ -57,7 +58,10 @@ define(function (require) {
5758
* function canvasPressed() {
5859
* userStartAudio();
5960
* carrier.amp(1.0);
60-
* carrier.start();
61+
* if(!hasStarted){
62+
* carrier.start();
63+
* hasStarted = true;
64+
* }
6165
* }
6266
*
6367
* function mouseReleased() {

0 commit comments

Comments
 (0)