c# - 在Unity C#中使用两个麦克风进行录音

标签 c# unity3d audio microphone recording

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

最佳答案

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

// 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);
}

关于c# - 在Unity C#中使用两个麦克风进行录音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53359442/

相关文章:

c# - Entity Framework 4 从具有多个模式的模型生成数据库

c# - 如何转换 GroupedEnumerable?

c# - 对 NPOT 纹理使用 OpenGL GL.TexSubImage2D 会导致伪影

c# - 向前拉伸(stretch)我旋转的球员

unity3d - Time.frameCount什么时候增加?

Android Quickblox 视频聊天错误

c# - 用于在 azure 中上传 blob 的文件名约定

c# - 在 Mac 上的 Unity 中使用 .NET 4.x

java - 在java中将音频转换为字节数组后实际存储的是什么?

audio - Gstreamer中的音频原始数据格式?