Created
September 2, 2016 10:29
-
-
Save mohayonao/896ceb6ef69160c033e002237b62f2a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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