unity3d - Unity 中带有 Photon Voice 2 的 Hololens 2018.2.13
问题描述
我对 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 构建时这项工作没有错误。
Microphone.Start 在 Photon Voice 2 库中的 MicWrapper 脚本中调用。
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);
}
解决方案
推荐阅读
- c# - 当我在平台统一下蹲下时,角色卡在地上
- google-cloud-dataflow - JdbcIO.Write.withResults 和 Wait.on 具有无界 PCollection 和 FixedWindow
- java - 运行 jar 文件返回错误:错误:无法找到或加载主类 MyClass 原因:java.lang.ClassNotFoundException:MyClass
- javascript - 使用 ReactJS / Typescript / Socket.io 同步视频时出现问题
- python - 绑定kivy的问题
- google-admin-sdk - 我需要能够从 Google 转销商控制台的转销商结算部分下载月度帐单
- java - 从对象的特定属性中组合多个值
- r - 在shinydashboardPlus()中将动态图片url链接传递给UI不起作用
- express - 使用 type-graphql typeorm 和 dataloader 处理一对多的最佳方法
- java - 我想巧妙地使用 for 循环打印一维数组。(爪哇)