I want to record two different audio streams using two different microphones connected to one audio interface (if necessary 2, I have an extra one) at the same time. I am not able to do this using the Microphone class in Unity. Please let me know how to go about this. Thank you so much!
void Start()
{
foreach (string device in Microphone.devices)
{
Debug.Log(device);
//Debug.Log(Microphone.devices[3]);
}
aud1 = GetComponent();
aud1.clip = Microphone.Start(Microphone.devices[2], true, 1, 44100);
aud1.loop = true;
aud1.mute = false;
aud2 = GetComponent();
aud2.clip = Microphone.Start(Microphone.devices[3], true, 1, 44100);
aud2.loop = true;
aud2.mute = false;
}
// Update is called once per frame
void Update()
{
aud1.clip.GetData(_samples1, 0);
aud2.clip.GetData(_samples2, 0);
}
This does not work for me. Any help is greatly appreciated. Thanks!