我在Hololens上的Photon Voice 2有问题。我有一个Unity 2017.4.13应用程序,可以在设备上正常运行Photon Voice 2。
但是,当迁移到Unity 2018.2.13时,它无法使用Microphone.Start
来启动麦克风,我可以通过传递一个空字符串作为麦克风类型来解决该错误,Unity文档建议该麦克风类型将使用默认麦克风,但是我在设备上遇到异常。
Unable to load DLL webrtc-audio: The specific module could not be found
在Unity 2018或总体上与Photon Voice 2中是否还有其他人遇到麦克风问题?
我应该添加我正在使用IL2CPP作为脚本后端,并且在构建设置中启用了麦克风权限。另外还要说明从Unity 2017.4.13构建时此工作没有错误。
在Photon Voice 2库中的MicWrapper脚本中调用Microphone.Start。
public MicWrapper(string device, int suggestedFrequency)
{
if (Microphone.devices.Length < 1)
{
return;
}
this.device = device;
int minFreq;
int maxFreq;
Microphone.GetDeviceCaps(device, out minFreq, out maxFreq);
var frequency = suggestedFrequency;
// minFreq = maxFreq = 44100; // test like android client
if (suggestedFrequency < minFreq || maxFreq != 0 && suggestedFrequency > maxFreq)
{
Debug.LogWarningFormat("[PV] MicWrapper does not support suggested frequency {0} (min: {1}, max: {2}). Setting to {2}",
suggestedFrequency, minFreq, maxFreq);
frequency = maxFreq;
}
this.mic = Microphone.Start(device, true, 1, frequency);
}