Skip to content

Commit

Permalink
added checks to avoid multiple start calls
Browse files Browse the repository at this point in the history
  • Loading branch information
endurance21 committed May 2, 2020
1 parent a5d6573 commit f423ee4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ define(function (require) {
* @example
* <div><code>
* let carrier, modulator;
* let hasStarted = false;
*
* function setup() {
* let cnv = createCanvas(100, 100);
Expand All @@ -57,7 +58,10 @@ define(function (require) {
* function canvasPressed() {
* userStartAudio();
* carrier.amp(1.0);
* carrier.start();
* if(!hasStarted){
* carrier.start();
* hasStarted = true;
* }
* }
*
* function mouseReleased() {
Expand Down

0 comments on commit f423ee4

Please sign in to comment.