The ability of resumable subs to return values (added in B4A v7.3) makes it very simple to add voice recognition to your app.
Code:
You can call it like this:
Example:
Example is attached.
Code:
B4X:
Private Sub RecognizeVoice As ResumableSub
vr.Listen
Wait For vr_Result (Success As Boolean, Texts As List)
If Success And Texts.Size > 0 Then
Return Texts.Get(0)
End If
Return ""
End Sub
You can call it like this:
B4X:
Wait For (RecognizeVoice) Complete (Result As String)
Example:
B4X:
Sub Activity_Click
Wait For (RecognizeVoice) Complete (Result As String)
If Result <> "" Then
Activity.Title = Result
End If
End Sub
Example is attached.