Skip to content

Instantly share code, notes, and snippets.

@captbaritone
Created August 16, 2017 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save captbaritone/2640628676cc5dfb1541e8255f707624 to your computer and use it in GitHub Desktop.
Save captbaritone/2640628676cc5dfb1541e8255f707624 to your computer and use it in GitHub Desktop.
Crash Safari
<script>
var context = new (window.AudioContext || window.webkitAudioContext)();
function start () {
var source = context.createOscillator();
var chanMerge = context.createChannelMerger(2);
var filter = context.createBiquadFilter();
source.connect(chanMerge, 0, 0);
source.connect(chanMerge, 0, 1);
// Connecting the channel merger directly to
// the biquad filter seems to be the problem.
chanMerge.connect(filter);
filter.connect(context.destination);
source.start(0);
source.stop(2); // This triggers the crash.
}
</script>
<p>Safari will crash on/before the end of the tone</p>
<button onclick='start()'>Play then crash</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment