Here's a quick example of voice recognition.
It just displays the results to the log window.
This example shows all the different recognized patterns that are returned by the Voice Module, usually 4 or 5 possibilities.
It just displays the results to the log window.
This example shows all the different recognized patterns that are returned by the Voice Module, usually 4 or 5 possibilities.
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim VR As VoiceRecognition
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
VR.Initialize("VR")
VR.Listen
End Sub
Sub VR_Result (Success As Boolean, Texts As List)
If Success = True Then
For i = 0 To Texts.Size -1
Log (Texts.Get(i))
Next
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Last edited: