[#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.
This commit is contained in:
Andy Sloane 2016-04-22 12:11:56 -07:00
commit ea423577f0

9
xm.js
View file

@ -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;
}