1
votes

I am writing a code that uses both speech and gesture recognition. I have used code from the Kinect Dev toolkit browser for speech and a blog (http://dotneteers.net/blogs/vbandi/archive/2013/03/25/kinect-interactions-with-wpf-part-i-getting-started.aspx) regarding the gesture control. The problem I am having is that I believe the initializations are interfering with each other.

private KinectSensor InitializeKinect()
    {

        CurrentSensor = KinectSensor.KinectSensors.FirstOrDefault();
        speechRecognizer = CreateSpeechRecognizer();
        CurrentSensor.Start();
        Start();
        return CurrentSensor;
    }

That interferes with

private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
    {
        this.sensorChooser = new KinectSensorChooser();
        this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged;       
        this.sensorChooserUi.KinectSensorChooser = this.sensorChooser;
        this.sensorChooser.Start();

somehow. I already edited the InitializeKinect function a little bit due to KinectStatus being an not comparable (== doesnt work).

If I comment out OnLoaded or InitalizeKinect in the MainWindow(), the other will work and if both are uncommented out, Speech only works.

Thanks for the help!

1

1 Answers

0
votes

I know nothing about Kinect, but - InitializeKinect looks like it's finding a Kinect sensor and initializing the SR engine (most likely using some Kinect information). I would remove the InitializeKinect call and add

speechRecognizer = CreateSpeechRecognizer();

just before

this.sensorChooser.Start();