diff --git a/Tone/shim/AudioContext.js b/Tone/shim/AudioContext.js index 4ef7d8ff..9eb8b34d 100644 --- a/Tone/shim/AudioContext.js +++ b/Tone/shim/AudioContext.js @@ -18,6 +18,12 @@ define(["Tone/core/Tone", "Tone/shim/OfflineAudioContext"], function(Tone){ //not functionally equivalent if (!AudioContext.prototype.resume){ AudioContext.prototype.resume = function(){ + //play some silent audio to jumpstart the context + var buffer = this.createBuffer(1, 1, this.sampleRate); + var source = this.createBufferSource(); + source.buffer = buffer; + source.connect(this.destination); + source.start(0); return Promise.resolve(); }; } diff --git a/gulp/karma.conf.js b/gulp/karma.conf.js index 2afaebf4..d07b9f72 100644 --- a/gulp/karma.conf.js +++ b/gulp/karma.conf.js @@ -111,13 +111,13 @@ module.exports = function(config){ flags : ["--no-sandbox", "--use-fake-ui-for-media-stream", "--use-fake-device-for-media-stream", "--autoplay-policy=no-user-gesture-required"] }, HeadlessFirefox : { - base : "Firefox", + base : "Firefox", flags : ["-headless"], - prefs : { - "media.navigator.permission.disabled" : true, + prefs : { + "media.navigator.permission.disabled" : true, "focusmanager.testmode" : true - } - } + } + } } };