From c248247c0a28f2238cc9a491600c29011d44b210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patr=C3=ADcia=20Santos?= Date: Wed, 17 May 2017 12:46:20 +0100 Subject: [PATCH] Unlock audio in Iphone/Ipad devices The unlock function wasn't working and after some research I found this solution: https://paulbakaus.com/tutorials/html5/web-audio-on-ios/ Just changed the `source.start(0)` to `source.noteOn(0)` and it worked. --- src/webaudio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webaudio.js b/src/webaudio.js index bbdc3afe..c5b2df7d 100644 --- a/src/webaudio.js +++ b/src/webaudio.js @@ -107,7 +107,7 @@ WebAudioOut.prototype.unlock = function(callback) { var source = this.context.createBufferSource(); source.buffer = buffer; source.connect(this.destination); - source.start(0); + source.noteOn(0); setTimeout(this.checkIfUnlocked.bind(this, source, 0), 0); };