Im trying to use Speech namespace to make voice recognition but it dosent work:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chocolade
    New Member
    • Aug 2010
    • 69

    #1

    Im trying to use Speech namespace to make voice recognition but it dosent work:

    Im using windows 7 and Visucal c# Express edition 2008 with .Net 3.5

    This is the code:



    using System;
    using System.Collecti ons.Generic;
    using System.Componen tModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows. Forms;
    using System.Speech;
    using System.Speech.S ynthesis;
    using System.Speech.R ecognition;
    using System.Speech.R ecognition.Srgs Grammar;

    namespace Speech_Recognit ion
    {
    public partial class Form1 : Form
    {

    Choices myChoices;
    GrammarBuilder myGrammerBuilde r;
    Grammar myGrammer;
    SpeechSynthesiz er mysynt;
    SpeechRecognize r myspeech;
    public Form1()
    {
    InitializeCompo nent();
    myChoices = new Choices();
    mysynt = new SpeechSynthesiz er();
    myspeech = new SpeechRecognize r();
    myspeech.Speech Recognized += rec_SpeechRecog nized;


    }

    private void Form1_Load(obje ct sender, EventArgs e)
    {
    myChoices.Add(" please");
    myGrammerBuilde r = new GrammarBuilder( myChoices);
    myGrammer = new Grammar(myGramm erBuilder);
    myspeech.LoadGr ammar(myGrammer );
    myspeech.Enable d = true;


    }
    void rec_SpeechRecog nized(object sender, SpeechRecognize dEventArgs e)
    {
    myLetters.Text = e.Result.Text;
    }

    }
    }


    I tried using my microphne but it dosent help i said please many times and nothing happened.

    What did i do wrong? I thought its something to do with culture settings but i couldnt find how to set it up.



    Thanks for helping
  • MartijnHoekstra
    New Member
    • Sep 2010
    • 39

    #2
    I dont directly see anything wrong with the code, nor have I any experience with this component.
    There are how ever few things I would check:
    - Is microphone recording anything at all
    - Is this microphone set as default input device?
    - or Must this app been told, which device to listen to?
    - What is level of sound quality needed for recognition, and is this achieved?
    - What happens if you try other words, or simple sounds "A", "B".. etc?
    - Are there more events on these components you can subscribe to? Just to get more feeling what can be done.
    - more?

    Comment

    Working...