semplice e naturale:
usa la tua voce
Attraverso MultiModalBerry è possibile, con pochissime righe di codice, realizzare un'applicazione che permetta l'accesso ai motori di sintesi vocale (TTS) e riconosciento vocale (ASR).
MultiModalBerry supporta lo sviluppo anche su diverse piattaforme con la stessa semplicità di utilizzo.
L'esempio riportato mostra come, con poche righe di codice, sia possibile:
#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 << "Non ho capito"; getchar();}
catch(TimeOutException toe){cout << "Time out"; getchar();}
catch(NoInputException nie){cout << "Non ho sentito"; 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;
}
Nel breve esempio riportato qui sotto viene evidenziata la semplicità nell'utilizzo di MultiModal Berry nel:
#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("Ciao, sono una prova",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;
}