programmer1337 Posted May 3, 2012 at 11:06 PM Report #453002 Posted May 3, 2012 at 11:06 PM Boas pessoal, estou a tentar desenvolver um form em c# para fazer o reconhecimento de voz mas tou com um problema diz "Não está instalado qualquer reconhecedor" Têm aqui a imagem para verem o que acontece... http://img841.imageshack.us/img841/5444/errobz.jpg Alguém tem alguma ideia como resolver isto ? :S Cumprimentos [[]] O código é o seguinte: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Speech.Synthesis; using System.Speech.Recognition; namespace TextToSpeech { public partial class Form1 : Form { SpeechRecognizer sr = new SpeechRecognizer(); public Form1() { InitializeComponent(); pictureBox1.BackColor = Color.Gray; Choices colors = new Choices(); colors.Add(new string[] {"red"}); colors.Add(new string[] {"green"}); colors.Add(new string[] {"blue"}); GrammarBuilder gb = new GrammarBuilder(); gb.Append(colors); // Create the Grammar instance. Grammar g = new Grammar(gb); sr.LoadGrammar(g); sr.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(sr_SpeechRecognized); } void sr_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { MessageBox.Show(e.Result.Text); } void speechReco_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { if (e.Result.Text.Equals("red") == true) { pictureBox1.BackColor = Color.Red; } else if (e.Result.Text.Equals("green") == true) { pictureBox1.BackColor = Color.Green; } else if (e.Result.Text.Equals("blue") == true) { pictureBox1.BackColor = Color.Blue; } } } }
M6 Posted May 4, 2012 at 07:57 AM Report #453014 Posted May 4, 2012 at 07:57 AM Creio que deves estar a referir-te a reconhecimento de fala e não de voz. Essa aplicação depende do facto de estar instalado no Windows um sistema de reconhecimento de fala. Se bem me recordo, no tempo do XP vinha um, mas acho que tinha de ser instalado à parte. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar."
apocsantos Posted May 4, 2012 at 08:59 AM Report #453021 Posted May 4, 2012 at 08:59 AM Bom dia, Deve estar a faltar instalar o Microsoft Speech SDK. http://www.microsoft.com/en-us/download/details.aspx?id=10121 Cordiais cumprimentos, Apocsantos "A paciência é uma das coisas que se aprendeu na era do 48k" O respeito é como a escrita de código, uma vez perdido, dificilmente se retoma o habito"
M6 Posted May 4, 2012 at 12:43 PM Report #453044 Posted May 4, 2012 at 12:43 PM Sim, é isso. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar."
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now