Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function selectAudioChannel(type) {
var splitter = audioCtx.createChannelSplitter(2);
audioSource.disconnect(); // ?
switch (type) {
case 'L':
audioSource.connect(splitter);
splitter.connect(audioCtx.destination, 0);
break;
case 'R':
audioSource.connect(splitter);
splitter.connect(audioCtx.destination, 1);
break;
default:
audioSource.connect(audioCtx.destination);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment