麦克风启动功能冻结统一应用程序
Microphone start function freezes unity app
启动麦克风会完全冻结整个应用程序 5 秒(总是 5 秒)。 Unity 5.6.0f3
代码:
public void StartRecording()
{
System.Diagnostics.Stopwatch sw1 = new System.Diagnostics.Stopwatch();
sw1.Start();
if (!Microphone.IsRecording(null))
{
m_ForcedStopRecording = false;
m_RecordingStartTime = Time.time;
Debug.Log("ms before start microphone 2: " + sw1.ElapsedMilliseconds);
m_RecordedAudio = Microphone.Start(null, false, m_MaxRecordingLengthInSeconds, m_RecordingFrequency);
Debug.Log("ms after start microphone: " + sw1.ElapsedMilliseconds);
StartCoroutine(WaitForRecordingTimeout());
}
Debug.Log("total StartRecording: " + sw1.ElapsedMilliseconds);
}
ms before start microphone 2 result says 0
启动麦克风后 ms 显示 5011
有什么建议吗?
您应该尝试将您的麦克风连接到不同的端口,如果它是 USB,则可能是您的计算机无法找到您的麦克风的问题
启动麦克风会完全冻结整个应用程序 5 秒(总是 5 秒)。 Unity 5.6.0f3
代码:
public void StartRecording()
{
System.Diagnostics.Stopwatch sw1 = new System.Diagnostics.Stopwatch();
sw1.Start();
if (!Microphone.IsRecording(null))
{
m_ForcedStopRecording = false;
m_RecordingStartTime = Time.time;
Debug.Log("ms before start microphone 2: " + sw1.ElapsedMilliseconds);
m_RecordedAudio = Microphone.Start(null, false, m_MaxRecordingLengthInSeconds, m_RecordingFrequency);
Debug.Log("ms after start microphone: " + sw1.ElapsedMilliseconds);
StartCoroutine(WaitForRecordingTimeout());
}
Debug.Log("total StartRecording: " + sw1.ElapsedMilliseconds);
}
ms before start microphone 2 result says 0 启动麦克风后 ms 显示 5011 有什么建议吗?
您应该尝试将您的麦克风连接到不同的端口,如果它是 USB,则可能是您的计算机无法找到您的麦克风的问题