Can't get multiple microphone inputs simultaneously

I’m trying to get two microphone volumes at once in unity. Unity supports microphone by this Microphones class (Unity - Scripting API: Microphone), but seems this class can only handle one Microphone at same time.

This is how my code looks. I’m running like this in two different scripts attached to two different objects. However, only the microphone initialized second will run and the first one will die when the second one starts.

How can I get multiple microphone inputs simultaneously? If there are no way to do in standard library, is there any useful plugins?

Thank you :slight_smile:

	void Start ()
	{

		deviceName = Microphone.devices[0];
		audio = this.gameObject.AddComponent<AudioSource>();
		audio.clip = 
            Microphone.Start(deviceName, true, 999, 44100);
		audio.loop = true;
		audio.mute = true;
        while (!(Microphone.GetPosition(deviceName) > 0))
		{
		}
		volumes = new float[LAppDefine.MIC_FRAME_NUM];
		audio.Play();
	}

I need this functionality too. I’m trying to cycle the mics, but thats causing me to lose audio.
How can I capture multiple audio devices (mics) at once.

It is pretty easy. You already have the script for 1 microphone.
Simply create a second game object and place the script on there.

Instead of typing the number 0, you can create an int variable, this way you can set the device to listen to in the inspector.

Alternatively you could use an enum to have words showing the microphone’s name and their position will automatically match their number on your system (thus the one you need between the .

That is how I do it in my script MicControl2.