I finally got around to playing with this a bit. The only issue I have is that occasionally an error event fires and it seems to kill the SR "service", meaning that my log stops showing any further SR events such as RMS levels.
I take it this is normal and the only recourse is to call
StartListening again? Sometimes that doesn't seem to restart it though.
EDIT: I'm not sure I want it to work this way, but is there a way for it to only respond after a keyword? For example, I have an app named Carma and it only wakes up if I say Carma. No beeping or anything else in the meantime. When I say "carma", it says "Yes" and then I hear a beep waiting for a command. Really, I was hoping to just listen for commands and ignore anything it doesn't recognize but it just keeps erroring out (i.e. No speech input, etc) after which I need to restart it and then it beeps again.
By the way, for anyone interested I have added error descriptions to the error sub:
Sub SpeechRecognition_Error (ErrorType As Int)
Dim sErrorMsg As String
Select Case ErrorType
Case 1
sErrorMsg = "Network operation timed out"
Case 2
sErrorMsg = "Network error"
Case 3
sErrorMsg = "Audio recording error"
Case 4
sErrorMsg = "Server sends error status"
Case 5
sErrorMsg = "Client-side error"
Case 6
sErrorMsg = "No speech input"
Case 7
sErrorMsg = "No recognition result matched"
Case 8
sErrorMsg = "RecognitionService busy"
Case 9
sErrorMsg = "Insufficient permissions"
Case Else
sErrorMsg = "Unknown error"
End Select
'StartListening ' Do this here?
Log("VR Error: " & ErrorType & " - " & sErrorMsg)
'CallSub2(Main, "ShowError", ErrorType) ' Currently not using this part
End Sub