iOS internal voice recognition features are not open to developers. This makes it more difficult to add voice recognition to your apps.
This class captures the microphone input when the user holds the button, sends it to api.ai service and then returns the resolved text:
In order to use this service you need to register with api.ai and set the two keys in the main module.
The code to consume this service is simple:
Note that the project requires B4i v2.0+
This class captures the microphone input when the user holds the button, sends it to api.ai service and then returns the resolved text:
In order to use this service you need to register with api.ai and set the two keys in the main module.
The code to consume this service is simple:
B4X:
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("Main")
NavControl.ShowPage(Page1)
Speak.Initialize(Me, "speak") 'initialize the object
Speak.AddToPanel(Panel1) 'add it to the layout
End Sub
public Sub Speak_Result(Success As Boolean, Resolved As String)
If Success Then
TextView1.Text = $"Resolved: ${Resolved}"$
Else
TextView1.Text = $"Error: ${Resolved}"$
End If
End Sub
Note that the project requires B4i v2.0+