开发者

Could not find a Kinect audio device InvalidOperationException

开发者 https://www.devze.com 2023-03-21 05:19 出处:网络
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 ins开发者_Sta

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 ins开发者_StackOverflow中文版tructed the project refuses to run.

Any one had a similar problem ??

var source = new KinectAudioSource()


Try to mark the Main with [MTAThread] attribute.

http://social.msdn.microsoft.com/Forums/en-US/kinectsdkaudioapi/thread/34369e7d-27f3-4e95-ac9a-36c9b7d5f3ba/


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:

  • Is the Kinect connected to your computer, and is the power supply plugged in/connected as well?
  • Did you install the x86 versions of all the speech libraries?


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.

catch (InvalidOperationException ex)
{
    MessageBox.Show(ex.Message);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号