Skip to content

Instantly share code, notes, and snippets.

@csnover
Last active August 29, 2015 14:20
Show Gist options
  • Save csnover/3dbfd4670b4f79a176f0 to your computer and use it in GitHub Desktop.
Save csnover/3dbfd4670b4f79a176f0 to your computer and use it in GitHub Desktop.
Spartan WebAudio bug: <audio> with playbackRate other than 1 is mute when routed through Web Audio API
<!DOCTYPE html>
<meta charset="utf-8">
<audio id="player" controls src="http://freedownloads.last.fm/download/415006180/So%2BSorry%2BGirl.mp3" type="audio/mp3"></audio><br>
<br>
<!-- playbackRate !== 1 should not cause audio to mute -->
Speed: <input type="range" min="0.5" max="2" value="1" step="0.01" onchange="player.playbackRate = +this.value">
<script>
var player = document.querySelector('#player');
if (window.AudioContext || window.webkitAudioContext) {
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var source = audioCtx.createMediaElementSource(player);
source.connect(audioCtx.destination);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment