From ea423577f0bd90e04ba626ac21cd0fa607388807 Mon Sep 17 00:00:00 2001 From: Andy Sloane Date: Fri, 22 Apr 2016 12:11:56 -0700 Subject: [PATCH] [#4] Re-enable iOS hack Before it was running a 1Hz oscillator for 10ms which caused a huge DC offset when it was done.. Turns out it works if you just immediately stop and disconnect it, without causing DC offsets or other problems. --- xm.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/xm.js b/xm.js index 2752dc8..49c00da 100644 --- a/xm.js +++ b/xm.js @@ -932,17 +932,12 @@ function play() { jsNode.connect(gainNode); // hack to get iOS to play anything - /* - * this seems to cause other player issues... disabling for now var temp_osc = player.audioctx.createOscillator(); temp_osc.connect(player.audioctx.destination); if (temp_osc.noteOn) temp_osc.start = temp_osc.noteOn; - temp_osc.frequency.value = 1; temp_osc.start(0); - setTimeout(10, function() { - temp_osc.disconnect(); - }); - */ + temp_osc.stop(); + temp_osc.disconnect(); } player.playing = true; }