Voice Recognition UNiTY

How can i adapt this Script to recognize voice command through the iphone. Commands like WALK, JUMP.

using System;
using Microsoft.Speech.Recognition;

namespace SpeechRecognitionApp
{
class Program
{
static void Main(string[ ] args)
{

// Create a SpeechRecognitionEngine object for the default recognizer in the en-US locale.
using (
SpeechRecognitionEngine recognizer =
new SpeechRecognitionEngine(
new System.Globalization.CultureInfo(“en-US”)))
{

// Create a grammar for finding services in different cities.
Choices services = new Choices(new string[ ] { “restaurants”, “hotels”, “gas stations” });
Choices cities = new Choices(new string[ ] { “Seattle”, “Boston”, “Dallas” });

GrammarBuilder findServices = new GrammarBuilder(“Find”);
findServices.Append(services);
findServices.Append(“near”);
findServices.Append(cities);

// Create a Grammar object from the GrammarBuilder and load it to the recognizer.
Grammar servicesGrammar = new Grammar(findServices);
recognizer.LoadGrammarAsync(servicesGrammar);

// Add a handler for the speech recognized event.
recognizer.SpeechRecognized +=
new EventHandler(recognizer_SpeechRecognized);

// Configure the input to the speech recognizer.
recognizer.SetInputToDefaultAudioDevice();

// Start asynchronous, continuous speech recognition.
recognizer.RecognizeAsync(RecognizeMode.Multiple);

// Keep the console window open.
while (true)
{
Console.ReadLine();
}
}
}

// Handle the SpeechRecognized event.
static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
Console.WriteLine("Recognized text: " + e.Result.Text);
}
}
}

Pretty sure the Microsoft.speech.recognition class is something specific to .NET in Windows only. It’s not in Mono, it’s not in Unity, and for that matter, it’s not on iOS, OSX, Linux or Android. That class only exists within the Windows OS itself.

You could make an external plugin to access that same recognition class. But as the class only exists on windows, your game could only work on windows.

Old thread, but hey. I’d be ok with windows-only. Would this involve copying certain DLL’s to the Plugins folder?