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 0761bc1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define(function (require) {
* @return {Tone.Signal} A Signal object from the Tone.js library
* @example
* <div><code>
* let carrier, modulator;
* let carrier, modulator,hasStarted = false;
*
* function setup() {
* let cnv = createCanvas(100, 100);
Expand All @@ -57,7 +57,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 0761bc1

Please sign in to comment.