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:
using System;
using System.Collections.Generic;
using System.Text;
using BerryCSharp.com.dotvocal.csberry;
namespace AsrExampleCSharp
{
class Program
{
static void Main(string[] args)
{
try
{
IRecognizer recognizer = CSBerry.CreateRecognizer();
recognizer.AddGrammar("nomi.bnf");
Console.WriteLine("Dimmi un nome:");
string detto = recognizer.Listen().BestValue;
Console.Write("hai detto " + detto);
}
catch (NoMatchException) { Console.Write("Non ho capito"); }
catch (TimeOutException) { Console.Write("Time out"); }
catch (NoInputException) { Console.Write("Non ho sentito"); }
catch (BerryConfigurationError bce){ Console.Write(bce.ToString()); }
catch (GrammarException ge) { Console.Write(ge.ToString()); }
catch (AsrRecException are) { Console.Write(are.ToString()); }
catch (Exception ex) { Console.Write(ex.ToString()); }
finally { Console.Read(); }
}
}
}
Nel breve esempio riportato qui sotto viene evidenziata la semplicità nell'utilizzo di MultiModal Berry nel:
using System;
using System.Collections.Generic;
using System.Text;
using BerryCSharp.com.dotvocal.csberry;
namespace TtsExampleCSahrp
{
class Program
{
static void Main(string[] args)
{
try
{
ISpeaker speaker = CSBerry.CreateSpeaker();
speaker.Speak("Ciao, sono una prova.");
speaker.Barrier();
}
catch (TtsException te)
{
Console.Write(te.ToString());
}
catch (BerryConfigurationError bce)
{
Console.Write(bce.ToString());
}
catch (Exception ex)
{
Console.Write("Errore: " + ex.ToString());
}
}
}
}