[Windows] Voice Recognition Server with KeyBoard emulation.


EDIT :
12-18-15 NEW VERSION !!!


Hi,

A small application that allows voice recognition from a grammar file (grammar.txt who should be in the same directory as the server).
The application uses the Windows API. It works under Vista 32/64, Win7 32/64, and maybe on Win8. (For XP, need probably install additional libraries.)
The server is multi-language. It use the default recognition language installed on the system. Of course, the grammar used must be consistent with it.

http://www.devmoons.net/OLDSERVER/pubip/reco_serveur_keyboard_source.zip
http://www.devmoons.net/OLDSERVER/pubip/RecoServeur_project.zip
http://www.devmoons.net/OLDSERVER/pubip/reco_serveur_keyboard.zip
http://www.devmoons.net/OLDSERVER/pubip/RecoServer.zip

#C >> ‘Magic’ word pronounced that close the Server. (This word must be present in the grammar.txt).
#S >> ‘Magic’ word pronounced that ENABLE the Keyboard Emulation. The focused application (Unity or Other) can receive character from the server. (This word must be present in the grammar.txt)
#E >> ‘Magic’ word pronounced that DISABLE the Keyboard Emulation.(This word must be present in the grammar.txt)
#V >> Validation recognition. 0 to 100%. 70 is a good number
#D >> Display (verbose) mode
#N >> Add a ‘NewLine Char \n’ after the reconized word/sentence. New !!!
# >> To add a comment.

Example of ‘grammar.txt

#C Close
#S Enable
#E Disable
#V 70
#N

Hello
Good morning
My name is Smith
Computer
Forward
Backward
Jump
Cover
Open a channel
Close the scene
Move your body my friend. It’s Unity
Left
Right
Close
Enable
Disable

Example of code with GetKeyDown. For more than one character and the CR, have a look to inputSting Unity - Scripting API: Input.inputString

using UnityEngine;
using System.Collections;

public class testVoiceGet : MonoBehaviour
{
   public string voiceInput;

   void Start()
   {
     Debug.Log("Waiting for voice input !!!");
   }

   void Update()
   {
     foreach (char c in Input.inputString)
     {
       if (c == "\n"[0] || c == "\r"[0])
       {
         Debug.Log(voiceInput);
         voiceInput = "";
       }
       voiceInput = voiceInput + c;
     }
   }
}

You can just open the NotePad for trying the server. Remember, after enabled the emulation, the server will send a sentence to every focused application.

Speech Training :

Happy new year… :slight_smile:

Edit 12-18-15.
Happy Christmas. :stuck_out_tongue:

Edit 30/11/16
New Download links.

One question… How would I install or implement this and make it run on game start?

ZJP, thank you for this. This is fantastic, but I am having trouble getting the keycode registered in Unity for some reason.

I have the Reco server up and running, have it properly drawing from the grammar file and sending designated keycodes on voice recognition to every program but the actual Unity game… both game view and builds…

WordPad, chrome, other tabs in Unity, and every other text box can all see the keycode, but the actual game will not register it. When I press the actual key, the desired result happens so I know it is not my Unity GetKeyDown… I can’t understand why it would work as a keycode everywhere except in a Unity game. Any ideas?

:face_with_spiral_eyes:
I’ll find out why …

Hi guys.
See the first post : the new version will solve every trouble encountered about getting a recognized word in Unity.

Update Download links in the first post.

Can update the download link? thank you.

This is awesome, trying to figure out why it needs a standalone server however and can’t just be run entirely from unity itself, would love to implement this in one of my apps as an alternative to using the windows native stuff available in windows 10 but the prospect of having to run a 3rd party server in the bg is killing me. Maybe I just don’t understand how this is working.