Advertisement

wit.ai with unity

Started by June 28, 2021 02:58 AM
0 comments, last by saraalaa8 3 years, 4 months ago

I'm following a course to learn augmented reality, using AI with unity

I have trained app on wit.ai to use to open the car door in my application it takes command as input with voice “openDriversDoor”

part of code

void Handle (string jsonString) {

if (jsonString != null) {

RootObject theAction = new RootObject ();

Newtonsoft.Json.JsonConvert.PopulateObject (jsonString, theAction);

if (theAction.entities.open != null) {

foreach (Open aPart in theAction.entities.open) {

Debug.Log (aPart.value);

carController.instance.triggerAnimation("openDriversDoor");

myHandleTextBox.text = aPart.value;

actionFound = true;

}

if (!actionFound) {

myHandleTextBox.text = "Request unknown, please ask a different way.";

} else {

actionFound = false;

} }

While input using my voice I get “Request unknown, please ask a different way. ”but in wit.ai it already recognizes my voice as it shows here in the screenshot

This topic is closed to new replies.

Advertisement