Skip to content

Instantly share code, notes, and snippets.

@owenstrevor
Created October 18, 2017 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owenstrevor/d18dd433d00051183dcacbcfb74cd39d to your computer and use it in GitHub Desktop.
Save owenstrevor/d18dd433d00051183dcacbcfb74cd39d to your computer and use it in GitHub Desktop.
ChannelMergerNode HTML5 Audio - Play in both speakers
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var myAudio = document.querySelector('audio');
var source = audioCtx.createMediaElementSource(myAudio);
var merger = audioCtx.createChannelMerger(1);
source.connect(merger);
merger.connect(audioCtx.destination);
@owenstrevor
Copy link
Author

Had a problem with dual channel audio playing different parts in the left speaker and the right speaker. I wanted it to play everything in both speakers so I had to hack this together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment