Jump to content

Recommended Posts

Posted

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

        }

    }
}


Posted

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."

 

Posted

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."

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.