Skip to content

Commit

Permalink
Add audio context configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
FabienMotte committed Jan 31, 2017
1 parent cc3dd97 commit 061b0f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

var Clubber = function (config) {
if (!config) config = {};
this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
this.audioCtx = config.context || new (window.AudioContext || window.webkitAudioContext)();

var analyser = this.audioCtx.createAnalyser();
analyser.fftSize = config.size || 2048;
Expand Down Expand Up @@ -262,4 +262,4 @@ Clubber.prototype.descriptions = [
"Adaptive high threshold relative to bounds"
];

module.exports = window.Clubber = Clubber;
module.exports = window.Clubber = Clubber;

0 comments on commit 061b0f6

Please sign in to comment.