audio-context-singleton
Advanced tools
Comparing version
10
index.js
@@ -40,13 +40,9 @@ /* global webkitAudioContext */ | ||
function passNewContext() { | ||
var acOpts; | ||
if (opts && opts.sampleRate) { | ||
acOpts = { sampleRate: opts.sampleRate }; | ||
} | ||
if (ctorOpts && ctorOpts.offline) { | ||
audioContext = new OfflineAudioContext(acOpts); | ||
audioContext = new OfflineAudioContext(opts); | ||
} else { | ||
if (typeof AudioContext === 'function') { | ||
audioContext = new AudioContext(acOpts); | ||
audioContext = new AudioContext(opts); | ||
} else { | ||
audioContext = new webkitAudioContext(acOpts); | ||
audioContext = new webkitAudioContext(opts); | ||
} | ||
@@ -53,0 +49,0 @@ } |
{ | ||
"name": "audio-context-singleton", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "When you want to have an audioContext singleton but don't want to rewrite [this code](index.js), use this. Deals with browser differences in AudioContext and maintains the singleton.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4832
-2.4%61
-6.15%