b3jsd73jfx
Active member
- Joined
- Mar 6, 2006
- Messages
- 28
- Programming Experience
- 1-3
Below is the codethat I currently have to try and do some basic speech recognition, but it just won't seem to work. Does anyone have any ideas?
VB.NET:
Dim WithEvents RecoContext As SpSharedRecoContext
Dim Grammar As ISpeechRecoGrammar
Private Sub RecoContext_Recognition(ByVal StreamNumber As Long, ByVal StreamPosition As Object, ByVal RecognitionType As SpeechRecognitionType, ByVal Result As ISpeechRecoResult)
Dim strText As String
strText = Result.PhraseInfo.GetText
MsgBox(strText)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
RecoContext = New SpSharedRecoContext
Grammar = RecoContext.CreateGrammar(1)
Grammar.DictationLoad()
Grammar.DictationSetState(SpeechRuleState.SGDSActive)
End Sub