comandi vocali e multimodali

documenti su applicazioni vocali e applicazioni multimodali

Salta il menu

semplice e naturale:

usa la tua voce

Applicazioni vocali voicexml e applicazioni multimodali



Sviluppo con C++

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.

Esempio con riconoscimento vocale (ASR)

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;
}

Esempio con sintesi vocale (TTS)

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;
}