找不到 Kinect 音频设备 InvalidOperationException
有谁知道为什么当 Speech 项目(在 Kinect SDK 中找到)中的下面的代码被击中时会抛出 InvalidOperationException 。我已经按照指示安装了先决条件,但项目拒绝运行。
有人遇到过类似的问题吗??
var source = new KinectAudioSource()
does any one know why the InvalidOperationException is being thrown when the code below in the Speech project (found in the Kinect SDK) is being hit. Ive installed of the prerequisite as instructed the project refuses to run.
Any one had a similar problem ??
var source = new KinectAudioSource()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用 [MTAThread] 属性标记 Main。
http://social.msdn.microsoft.com/Forums/en-US/kinectsdkaudioapi/thread/34369e7d-27f3-4e95-ac9a-36c9b7d5f3ba/
Try to mark the Main with [MTAThread] attribute.
http://social.msdn.microsoft.com/Forums/en-US/kinectsdkaudioapi/thread/34369e7d-27f3-4e95-ac9a-36c9b7d5f3ba/
当我没有将 Kinect 插入我的计算机时,我曾在该行上抛出过 InvalidOperationException 异常。除了上面 Danejir 的建议(看看到底是什么问题)之外,还要检查:
I had an InvalidOperationException thrown on that line once before when I didn't have the Kinect plugged into my computer. Besides what Danejir suggests above (seeing what the issue is exactly), also check:
在调用 Runtime 对象上的任何其他方法之前,应用程序必须通过调用 Runtime.Initialize 来初始化 Kinect 传感器。 Runtime.Initialize 初始化内部帧捕获引擎,该引擎启动一个线程,从 Kinect 传感器检索数据,并在帧准备就绪时向应用程序发出信号。
如果无法找到 Kinect 传感器,Initialize 方法将抛出 InvalidOperationException。
An application has to initialize the Kinect sensor by calling Runtime.Initialize before calling any other methods on the Runtime object. Runtime.Initialize initializes the internal frame-capture engine, which starts a thread that retrieves data from the Kinect sensor and signals the application when a frame is ready.
The Initialize method is going to throw an InvalidOperationException if it fails to find a Kinect sensor.