I am trying to split the audio channels of my stereo microphone (SingStar Microphone). They are 2 microphones connected to one USB input actually and they send audio on either the left or the right channel. The issue is that when I sing into one of the microphones, the other channel get completely muted and does not pick up any audio. It doesn't matter which microphone. The first one to pick up audio works and the other cuts out until you stop the audio on the first microphone. (Weird is that if you input roughly the same audio into both at the same time they do pick up the audio on both channels, that makes me think it is some pre processing or something like that to remove background noise on stereo microphones but I am not sure about that). The issue is in chrome, I am not sure if Safari or Firefox have that problem but I am limited to chrome because I am using Electron.
I already disabled all the preprocessing options here. Without echoCancellation, both channels send the same audio signal.
stream = await navigator.mediaDevices.getUserMedia({
audio: {
deviceId: { exact: microphone.id },
echoCancellation: false,
autoGainControl: false,
noiseSuppression: false,
},
})
I then split the channels using the channelSplitter. The audio is put into a worklet but that shouldn't matter for the issue. The code here get's run twice, once for channel 0 and once for channel 1.
const stream = await this.createMediaStream(microphone)
const source = this.ctx.createMediaStreamSource(stream)
// separate audio channels
const splitterNode = this.ctx.createChannelSplitter(2)
source.connect(splitterNode)
const pitchWorkletNode = await this.createPitchWorkletNode(microphone)
splitterNode.connect(pitchWorkletNode, microphone.channel, 0)
I tried adjusting different settings like explicitly setting the channelCount to 2 or running getUserMedia twice to get 2 different streams and many more things that I don't really remember. Nothing changed the issue.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/wbkqJ68
Comments
Post a Comment