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… ![]()
Edit 12-18-15.
Happy Christmas. ![]()
Edit 30/11/16
New Download links.