#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: Voice Automation
#VersionCode: 1
#VersionName: Voice Automation
#SupportedOrientations: landscape
#CanInstallToExternalStorage: False
#End Region
Sub Process_Globals
Dim VR As VoiceRecognition
Dim TTS1 As TTS
End Sub
Sub Globals
Dim btVoice As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
VR.Initialize("VR")
TTS1.Initialize("TTS1")
End If
Activity.LoadLayout("1")
End Sub
Sub btVoice_Click
VR.Listen
If VR.IsSupported Then
VR.Prompt = "Say hello"
Else
ToastMessageShow("Voice recognition is not supported.", True)
End If
End Sub
Sub VR_Result (Success As Boolean, Texts As List)
If Success = True Then
'**//** example **\\**
If Texts.Get(0) = "Hello" Then
TTS1.Speak("recognized order", True)
'go here to a database sql of the results of the data analysis
Else
TTS1.Speak("Unknown command. Please start again", True)
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub