Dictation grammar????
-
Good day to all I have this problem with the code below; I want the system to simply write what it hears with out using the grammar. is there any way to do that? I've tried removing the grammar file but it did not work. any help or suggestions
'Default Imports
Imports System
Imports System.Data
Imports System.Deployment
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Xml'Custom Imports
Imports SpeechLibPublic Class Form1
'DeclaresDim WithEvents RecoContext As SpSharedRecoContext 'The Main Recognition Object Used throughout the whole program. -- Shared Object: More Info on this later. Dim Grammar As ISpeechRecoGrammar 'The Grammar Object so the program knows what is going on. -- Instanced Object: More Info on this later. Dim CharCount As Integer 'This is used to count the amount of chars that are in the text box. ''''Subs Start Here 'Start Button. This will engage reco, and start the entire process. Private Sub btnStart\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click 'First check to see if reco has been loaded before. If not lets load it. If (RecoContext Is Nothing) Then RecoContext = New SpSharedRecoContextClass 'Create a new Reco Context Class Grammar = RecoContext.CreateGrammar(1) 'Setup the Grammar Grammar.DictationLoad() 'Load the Grammar End If lblStatus.Text = "Recognition Started" 'Change the Label to let the user know whats up Grammar.DictationSetState(SpeechRuleState.SGDSActive) 'Turns on the Recognition. This is Vitally important 'This is so the user doesn't break the program by 'trying to start the recognition after its already started. btnStart.Enabled = False btnStop.Enabled = True End Sub '''' 'Stop Button. This will stop stop the recoginition Private Sub btnStop\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click Grammar.DictationSetState(SpeechRuleState.SGDSInactive) 'Turns off the Recognition. It will go dormant. lblStatus.Text = "Recognition Stopped" 'Change the label to let the user know whats up 'Again This is so the user doesn't go breaking things accidently btnStart.Enabled = True
-
Good day to all I have this problem with the code below; I want the system to simply write what it hears with out using the grammar. is there any way to do that? I've tried removing the grammar file but it did not work. any help or suggestions
'Default Imports
Imports System
Imports System.Data
Imports System.Deployment
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Xml'Custom Imports
Imports SpeechLibPublic Class Form1
'DeclaresDim WithEvents RecoContext As SpSharedRecoContext 'The Main Recognition Object Used throughout the whole program. -- Shared Object: More Info on this later. Dim Grammar As ISpeechRecoGrammar 'The Grammar Object so the program knows what is going on. -- Instanced Object: More Info on this later. Dim CharCount As Integer 'This is used to count the amount of chars that are in the text box. ''''Subs Start Here 'Start Button. This will engage reco, and start the entire process. Private Sub btnStart\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click 'First check to see if reco has been loaded before. If not lets load it. If (RecoContext Is Nothing) Then RecoContext = New SpSharedRecoContextClass 'Create a new Reco Context Class Grammar = RecoContext.CreateGrammar(1) 'Setup the Grammar Grammar.DictationLoad() 'Load the Grammar End If lblStatus.Text = "Recognition Started" 'Change the Label to let the user know whats up Grammar.DictationSetState(SpeechRuleState.SGDSActive) 'Turns on the Recognition. This is Vitally important 'This is so the user doesn't break the program by 'trying to start the recognition after its already started. btnStart.Enabled = False btnStop.Enabled = True End Sub '''' 'Stop Button. This will stop stop the recoginition Private Sub btnStop\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click Grammar.DictationSetState(SpeechRuleState.SGDSInactive) 'Turns off the Recognition. It will go dormant. lblStatus.Text = "Recognition Stopped" 'Change the label to let the user know whats up 'Again This is so the user doesn't go breaking things accidently btnStart.Enabled = True
If you don't want grammar, could you not simply have each line of text saved into a variable, then remove any grammatical items from that variable before outputting it to your textbox (or wherever it is going to)?
Knowledge is knowing that the tomato is a fruit. Wisdom is not putting it in fruit salad!! Booger Mobile - Camp Quality esCarpade 2010
-
If you don't want grammar, could you not simply have each line of text saved into a variable, then remove any grammatical items from that variable before outputting it to your textbox (or wherever it is going to)?
Knowledge is knowing that the tomato is a fruit. Wisdom is not putting it in fruit salad!! Booger Mobile - Camp Quality esCarpade 2010