Partial Class Default2 Inherits System.Web.UI.Page Dim rec As New SpeechRecognizer Dim gb As GrammarBuilder Dim g As Grammar Dim c As New Choices() Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Try c.Add("one") c.Add("two") c.Add("three") c.Add("four") Dim gb = New GrammarBuilder(c) Dim g = New Grammar(gb) With rec .LoadGrammar(g) .Enabled = True End With Catch ex As Exception End Try End Sub Public Sub rec_SpeechRecognized(ByVal sender As Object, ByVal e As SpeechRecognizedEventArgs) lblLetter.Text = e.Result.Text End Sub End Class
Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)