Groups > Microsoft > dotNET Speech SDK > Re: SpeechRecognitionRejeted event




Re: SpeechRecognitionRejeted event

Re: SpeechRecognitionRejeted event
12 Apr 2007 07:46:23 -0700
On Apr 12, 5:21 am, "B#.." <bruno.reme...@wanadoo.fr> wrote:
> Hi,
>
> I want to perform an action when the SR engine is not able  to reconize an
> user's sentence.
> But when the event is raised the procedure which handle it is carried out
> uninterrupted ...
> It seems the SR raise the event continuously after a bad recognition.
>
> How can i do to perform my handler one time by bad sentence ?
>
> Bests Regards,
>
> B#

Post Reply
Re: SpeechRecognitionRejeted event
12 Apr 2007 07:49:17 -0700
Bruno,

>From my experience, that just doesn't sound right.  A phrase is either
recognized or it is rejected.  Is it possible that new phrases are
being recognized after the first one and that these are being
recognized?  Perhaps you can copy/paste some of your code to show what
is going on.

Post Reply
SpeechRecognitionRejeted event
Thu, 12 Apr 2007 11:21:05 +020
Hi,

I want to perform an action when the SR engine is not able  to reconize an 
user's sentence.
But when the event is raised the procedure which handle it is carried out 
uninterrupted ...
It seems the SR raise the event continuously after a bad recognition.

How can i do to perform my handler one time by bad sentence ?

Bests Regards,

B# 

Post Reply
Re: SpeechRecognitionRejeted event
13 Apr 2007 07:22:03 -0700
On Apr 13, 2:42 am, "B#" <bruno.reme...@wanadoo.fr> wrote:
> Hi James,
>
> Thank for your help.
>
> Here's my (simplified) code : I load a first grammar(ecoute), and if some
> sentences are recognized i change for another grammar.(Analyse)
> It's with this second grammar i need to manage the unrecognized sentences.
> in "moteurReconnaissance_SpeechRecognitionRejected", i try to
know which
> grammar is loaded, and i execute the code if it's the second one.
> But this procedure is carried out much once for one sentence not
recognized
> (10 or 12 times)...
> Perhaps surrounding noises ... but in this case, i don't know how to do to
> filter the sentences...
>
> Bests regards,
>
> B#
>
>         SpeechRecognitionEngine moteurReconnaissance = new
> SpeechRecognitionEngine();
>
>         public Form1()
>         {
>             InitializeComponent();
>             moteurReconnaissance.SetInputToDefaultAudioDevice();
>             Detection.Analyse.SpeechRecognized += new
>
EventHandler<System.Speech.Recognition.SpeechRecognizedEventArgs>(Analyse_
S­peechRecognized);
>             Detection.Ecoute.SpeechRecognized += new
>
EventHandler<System.Speech.Recognition.SpeechRecognizedEventArgs>(Ecoute_S
p­eechRecognized);
>
>           moteurReconnaissance.SpeechRecognitionRejected += new
> EventHandler<SpeechRecognitionRejectedEventArgs>
> moteurReconnaissance_SpeechRecognitionRejected);
>             moteurReconnaissance.LoadGrammar(Detection.Ecoute);
>
>             moteurReconnaissance.RecognizeAsync(RecognizeMode.Multiple);
>
>        }
>
>         void moteurReconnaissance_SpeechRecognitionRejected(object sender,
> SpeechRecognitionRejectedEventArgs e)
>         {
>             if (moteurReconnaissance.Grammars.Contains(Detection.Analyse))
>             { voix.Annonce("Je n'ai pas compris votre souhait. Pouvez
vous
> répéter ?"); }
>         }
>
>         void Ecoute_SpeechRecognized(object sender,
> System.Speech.Recognition.SpeechRecognizedEventArgs e)
>         {
>             if (e.Result.Confidence > 0.8)
>             {
>                ...
>                 moteurReconnaissance.UnloadGrammar(Detection.Ecoute);
>                 moteurReconnaissance.LoadGrammar(Detection.Analyse);
>
>             }
>         }
>
>         void Analyse_SpeechRecognized(object sender,
> System.Speech.Recognition.SpeechRecognizedEventArgs e)
>         {
>             if (e.Result.Confidence > 0.8)
>             {
>               ...
>                 moteurReconnaissance.UnloadGrammar(Detection.Analyse);
>                 moteurReconnaissance.LoadGrammar(Detection.Ecoute);
>             }
>
>         }
>
> "James Ashley" <magister.lud...@gmail.com> a écrit dans le
message denews:1176389356.984651.245270@o5g2000hsb.googlegroups.com...
>
>
>
> > Bruno,
>
> >>From my experience, that just doesn't sound right.  A phrase is
either
> > recognized or it is rejected.  Is it possible that new phrases are
> > being recognized after the first one and that these are being
> > recognized?  Perhaps you can copy/paste some of your code to show
what
> > is going on.- Hide quoted text -
>
> - Show quoted text -

Bruno,

I can't verify this, because it only occurred sporadically, but I got
the impression in my own application that when I loaded a grammar, it
would sometimes attempt to recognize the phrase that was in the queue,
causing me to have two recognition events for the same phrase.  You
might want to try toggling the Enabled property of your grammars to
activate and de-activate them, rather than loading and unloading
them.  It might fix your issue.  Also, loading and unloading can be
slow processes, which is another reason you would want to set the
Enabled property instead.

James
Post Reply
Re: SpeechRecognitionRejeted event
Fri, 13 Apr 2007 08:42:51 +020
Hi James,

Thank for your help.

Here's my (simplified) code : I load a first grammar(ecoute), and if some 
sentences are recognized i change for another grammar.(Analyse)
It's with this second grammar i need to manage the unrecognized sentences.
in "moteurReconnaissance_SpeechRecognitionRejected", i try to know
which 
grammar is loaded, and i execute the code if it's the second one.
But this procedure is carried out much once for one sentence not recognized 
(10 or 12 times)...
Perhaps surrounding noises ... but in this case, i don't know how to do to 
filter the sentences...

Bests regards,

B#

        SpeechRecognitionEngine moteurReconnaissance = new 
SpeechRecognitionEngine();

        public Form1()
        {
            InitializeComponent();
            moteurReconnaissance.SetInputToDefaultAudioDevice();
            Detection.Analyse.SpeechRecognized += new 
EventHandler<System.Speech.Recognition.SpeechRecognizedEventArgs>(Analyse_
SpeechRecognized);
            Detection.Ecoute.SpeechRecognized += new 
EventHandler<System.Speech.Recognition.SpeechRecognizedEventArgs>(Ecoute_S
peechRecognized);

          moteurReconnaissance.SpeechRecognitionRejected += new 
EventHandler<SpeechRecognitionRejectedEventArgs> 
moteurReconnaissance_SpeechRecognitionRejected);
            moteurReconnaissance.LoadGrammar(Detection.Ecoute);

            moteurReconnaissance.RecognizeAsync(RecognizeMode.Multiple);

       }

        void moteurReconnaissance_SpeechRecognitionRejected(object sender, 
SpeechRecognitionRejectedEventArgs e)
        {
            if (moteurReconnaissance.Grammars.Contains(Detection.Analyse))
            { voix.Annonce("Je n'ai pas compris votre souhait. Pouvez vous

répéter ?"); }
        }

        void Ecoute_SpeechRecognized(object sender, 
System.Speech.Recognition.SpeechRecognizedEventArgs e)
        {
            if (e.Result.Confidence > 0.8)
            {
               ...
                moteurReconnaissance.UnloadGrammar(Detection.Ecoute);
                moteurReconnaissance.LoadGrammar(Detection.Analyse);

            }
        }

        void Analyse_SpeechRecognized(object sender, 
System.Speech.Recognition.SpeechRecognizedEventArgs e)
        {
            if (e.Result.Confidence > 0.8)
            {
              ...
                moteurReconnaissance.UnloadGrammar(Detection.Analyse);
                moteurReconnaissance.LoadGrammar(Detection.Ecoute);
            }

        }



"James Ashley" <magister.ludens@gmail.com> a écrit dans le
message de 
news:1176389356.984651.245270@o5g2000hsb.googlegroups.com...
> Bruno,
>
>>From my experience, that just doesn't sound right.  A phrase is either
> recognized or it is rejected.  Is it possible that new phrases are
> being recognized after the first one and that these are being
> recognized?  Perhaps you can copy/paste some of your code to show what
> is going on.
>
> 
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact