在 Unity C# 中用两个麦克风录音

Recording with two microphones in Unity C#

感谢您来到这里。 我有两个连接到 PC 的麦克风,我想同时录制它们的声音。有可能做到这一点吗?任何方法。也许我需要购买一些设备?

您应该能够使用麦克风获取可用录音设备的列表class

// Get list of Microphone devices and print the names to the log
void Start()
{
    foreach (var device in Microphone.devices)
    {
        Debug.Log("Name: " + device);
    }
}

您可以使用此设备列表从每个设备创建音频剪辑

[SerializeField]
private AudioSource audioSource1;
[SerializeField]
private AudioSource audioSource2;

// Start recording with built-in Microphone and play the recorded audio right away
private IEnumerator Record()
{
    audioSource1.clip = Microphone.Start("<audio-device-1>", true, 10, 44100);
    audioSource2.clip = Microphone.Start("<audio-device-2>", true, 10, 44100);
}