|
I am facing many problems with .net framework's speech recognition technology
Here is my code it checks only for 2 choices black and white but when i say 1 it changes background color to white(this is really weird) I have already done computer training and even when i say 1 and it thinks it detected it right i get a confidence of 0.9 which blows my mind
Imports System.Speech.Synthesis
Imports System.Speech.Recognition
Public Class Form1
Dim speaker As New SpeechSynthesizer
Public WithEvents recog As New SpeechRecognitionEngine
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
recog.RecognizeAsyncStop()
recog.Dispose()
End Sub
Private Sub getcolorintoarray()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
speaker.SpeakAsync("Hello")
Dim grammarbuilder As New System.Speech.Recognition.GrammarBuilder
Dim choices As New System.Speech.Recognition.Choices({"Black", "White"})
grammarbuilder.Append(choices)
Dim grammar As New System.Speech.Recognition.Grammar(grammarbuilder)
recog.LoadGrammar(grammar)
recog.SetInputToDefaultAudioDevice()
recog.RecognizeAsync(RecognizeMode.Multiple)
End Sub
Private Sub recog_SpeechRecognized(ByVal sender As Object, ByVal e As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles recog.SpeechRecognized
If e.Result.Confidence > 0.8 And e.Result.Text = "Black" Then
MsgBox(e.Result.Confidence)
Me.BackColor = Color.Black
ElseIf e.Result.Confidence > 0.8 And e.Result.Text = "White" Then
MsgBox(e.Result.Confidence)
Me.BackColor = Color.White
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
recog.RecognizeAsyncStop()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
recog.RecognizeAsync(RecognizeMode.Multiple)
End Sub
End Class
|
|
|
|
|
..and what does e.Result.Text contain?
|
|
|
|
|
Do you think this is funny ?
|
|
|
|
|
saurabh orange vyas wrote: Do you think this is funny ? I doubt it; he asked you a serious question. What is the content of that field when the code runs?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
My Bad When I say 1 at microphone it detects it as white and e.result.text is also definitely white
|
|
|
|
|
You need to explain why that is wrong.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
How would i know that ? everything is working fine you have code why not test it yourself
|
|
|
|
|
We do not come here to do your work for you. If you cannot be bothered to try and diagnose your problem then don't be surprised if no one else does.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I dont Expect any Help from you either ill figure out that myself
Just a personal advice kill your ego!
|
|
|
|
|
saurabh orange vyas wrote: Just a personal advice kill your ego! Some for you: if you have a problem then explain it clearly. If you are asked for more information, provide it. As tyou do not pay for the help here, don't expect other people to do your work for you. And finally, learn some manners.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Ill keep that in mind from next time
|
|
|
|
|
saurabh orange vyas wrote: why not test it yourself
That'd be a lot of work, if we had to test each piece of code.
It's not rong, the words just hound alike for a computer. "Gimme one white height".
|
|
|
|
|
Do you think i havnt done any testing of this issue just posted it so that you guys can help i spent 2 days on this , tested on different platforms configured settings but still got the error
|
|
|
|
|
I would guess you did, but you didn't say so in the question. Taking a rational approach, we look to identify the first possible point of failure, and work up from there. Debugging would probably be more beneficial then experimenting with different settings and platforms.
If you're convinced that the code is correct, I'd guess that the speech-engine does not have a "1" in it's dictionary, and being a non-existent word, it'd take the next best thing.
You're welcome, enjoy
|
|
|
|
|
Eddy Vluggen wrote: I'd guess that the speech-engine does not have a "1" in it's dictionary
That would be really crappy dictionary if it would not have numbers in it.
No more Mister Nice Guy... >: |
|
|
|
|
|
Eddy Vluggen wrote: I'd guess that the speech-engine does not have a "1" in it's dictionary, and being a non-existent word, it'd take the next best thing.
Actually, that looks to be exactly the problem. The grammarbuilder only has two words loaded into it, "Black" and "White". Given that "White" and "One" both start the same phonetically, it seems quite likely it's getting a high match probability.
|
|
|
|