simple and natural:
use your voice
With MultiModalBerry you can, with just a few line of code, develop an application controlling your Text-to-Speech (TTS) and Automatic Speech Recognition (ASR) engines.
the following example shows how you can with few lines:
#include "stdafx.h"
#include "berry.h"
int _tmain(int argc, _TCHAR* argv[])
{
MM_Berry* berry = NULL;
try
{
MM_Berry* berry = new MM_Berry(NULL,NULL,NULL);
berry_grammar_t *gram = new berry_grammar_t();
gram->bin = false;
gram->grmName="nomi.bnf";
cout << berry->listen(gram,1,5000,5000,5000,ASR_DP_AUTO,0);
getchar();
}
catch(NoMatchException nme){cout << "I didn't understand"; getchar();}
catch(TimeOutException toe){cout << "Time out"; getchar();}
catch(NoInputException nie){cout << "I didn't hear you"; getchar();}
catch(GrammarException ge){cout << ge.what(); getchar();}
catch(TtsException te){cout << te.what(); getchar();}
catch(AsrRecException are){cout << are.what(); getchar();}
catch(exception ex){ cout<< ex.what(); getchar();}
delete berry;
}
The example below shows how to use MultiModal Berry in order to:
#include "stdafx.h"
#include "berry.h"
int _tmain(int argc, _TCHAR* argv[])
{
MM_Berry* berry = NULL;
try
{
MM_Berry* berry = new MM_Berry(NULL,NULL,NULL);
berry->speak("Hello World",100,50);
berry->barrier();
getchar();
}
catch(TtsException te){cout <<te.what(); getchar();}
catch(AsrRecException are){cout << are.what(); getchar();}
catch(exception ex){ cout << ex.what(); getchar();}
delete berry;
}