1
Vote

v797 - Kinect crash - not sure why

description

The Kinect module crashed Mayhem as I was trying to delete a few connections and clear my workspace in the program; not sure what caused the crash, but here's the error message from the IDE:

InvalidOperationException was unhandled by user code
No Key exists with that spoken text

private static void SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    {
        if (!recognitions.ContainsKey(e.Result.Text))
        {
            throw new InvalidOperationException("No Key exists with that spoken text");
        }


        var handlers = recognitions[e.Result.Text];  ///////////////////////////THIS IS THE LINE OF CODE THE ERROR POINTED TO
        foreach (Action<SpeechRecognizedEventArgs> action in handlers)
        {
            ThreadPool.QueueUserWorkItem(o => action(e));
        }
    }

comments