Skip to content

Commit

Permalink
Merge pull request #29 from Costava/audiocontext-close
Browse files Browse the repository at this point in the history
Close old AudioContexts
  • Loading branch information
meenie committed Jun 22, 2016
2 parents 2ccc0dd + febde11 commit 8244081
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/conductor.js
Expand Up @@ -175,6 +175,7 @@ function Conductor(tuning, rhythm) {
* Remove all instruments and recreate AudioContext
*/
conductor.destroy = function() {
conductor.audioContext.close();
conductor.audioContext = new AudioContext();
conductor.instruments.length = 0;
conductor.masterVolume = conductor.audioContext.createGain();
Expand Down

0 comments on commit 8244081

Please sign in to comment.