Modules

U Recog

LATEST VERSION 1.3 (21.11.2011)

Description:

URBI module for speech recognition based on Microsoft SAPI. SAPI incarnation of Microsoft's Speech API - allowing programmers to add speech recognition and synthesis into their programs. It is based on a COM interface. The command and control features of SAPI are implemented as context-free grammars (CFGs). A CFG is a structure that defines a specific set of words, and the combinations of these words that can be used. In basic terms, a CFG defines the sentences that are valid, and in SAPI, defines the sentences that are valid for recognition by a speech recognition (SR) engine.

More about SAPI: http://msdn.microsoft.com/en-us/library/ms723627(v=vs.85).aspx

Context-free grammars:

The CFG format in SAPI defines the structure of grammars and grammar rules using Extensible Markup Language (XML). The application can dynamically update an already loaded SAPI XML grammar.
Example:

 <RULE NAME="Travel" TOPLEVEL="ACTIVE">
      <LIST>
         <PHRASE>fly to</PHRASE>
         <PHRASE>drive to</PHRASE>
         <PHRASE>take train to</PHRASE>
      </LIST>
      <LIST>
         <PHRASE>Seattle</PHRASE>
         <PHRASE>New York</PHRASE>
         <PHRASE>Washington DC</PHRASE>
      </LIST>
   </RULE>

More about XML grammar files you can find here: http://msdn.microsoft.com/en-us/library/ms717320(v=VS.85).aspx

Module functions:

URecog.new(); - initialize TTS
URecog.start(engine, volume, xml_grammar); - start recognition engine
engine - you can choose "InProc" In-process or "InShared" shared engine
volume - set volume level
xml_grammar - xml grammar file
URecog.pause(); - pause recognition engine
URecog.resume(); - resume recognition engine
URecog.stop(); - stop recognition
URecog.addPhrase(rule, word); - add dynamicaly sentance to recognition
URecog.resetGrammar(); - clear all grammar rules
URecog.setDictationState(SPRULESTATE); - sets the dictation topic state.
Flag of type SPRULESTATE indicating the new state of dictation.
0 - SPRS_INACTIVE
1 - SPRS_ACTIVE
3 - SPRS_ACTIVE_WITH_AUTO_PAUSE
4 - SPRS_ACTIVE_USER_DELIMITED
URecog.spinterference - possible causes of poor recognition
("none", "noise", "nosignal", "tooloud", "tooquiet", "toofast", "tooslow")
URecog.result - recognition result
URecog.srFalse - false recognition flag (1 - false occur)
URecog.isListening - recognition process flag
URecog.state - recognition state ("run", "stop", "pause")


loadModule("URecog");
var recog=URecog.new();
recog.start("InProc",1000,""),
waituntil (recog.state=="run");
sleep(1);
recog.addPhrase("","my name is John");
recog.addPhrase("","please start game");
recog.addPhrase("","yes");
recog.addPhrase("","no");
recog.addPhrase("","stop game");
recog.addPhrase("","one");
recog.addPhrase("","two");
recog.addPhrase("","three");

recog.&result.notifyChange( closure() {
   echo(recog.result);
});

Download here:




WRUT

Options: