Search code examples
tokbox

Can TokBox handle multiple microphones


I'm trying to connect multiple microphones to my web app.

But I haven't been able to get TokBox to list more than one microphone.

I am using the computer's built-in mike, plus my smartphone's mike as a secondary microphone, via DroidCam.

Can TokBox handle multiple microphones on the same computer?

If possible, can I do this with DroidCam? If not, how can I connect multiple (three) microphones and select them on TokBox?

Thanks.


Solution

  • I dont know that tokbox provides this directly but you could potentially use MultiStreamsMixer

    https://github.com/muaz-khan/MultiStreamsMixer

    const audioMixer = new MultiStreamsMixer([microphone1, microphone2]);
    const mixedStream = audioMixer.getMixedStream();
    

    and then give the tokbox publisher (via setAudioSource) the mixed stream.