Hi !
I'm new to B4A , this is my first post, and first I'd like to thank all the community of B4X .
Thank you Brandsum for this nice libray.
I'm about to change the native Speech recognition by this one in my app !!
I've noticed that with the example given with the libray here , the Sub sr_Results is executed more than once.
I added logs to the begining of the sub and I can notice that its executed in that way :
if here is only one result in Texts , it is run once, while if there are more than 1 result in Texts, the Sub is executed twice.
In my app, I use the sr_Results Sub to do another action that need only to be executed once per click on button, exactlty like in the app example.
How can I get the SR_Results Sub to be run only once ? (even if there a more than one results in the results, is can be kept in the list, I just want to use Texts.get(0) as the best match for my app).
I hope my request is enough easy to understand!
Thank you for your help an advice.
I'm new to B4A , this is my first post, and first I'd like to thank all the community of B4X .
Thank you Brandsum for this nice libray.
I'm about to change the native Speech recognition by this one in my app !!
I've noticed that with the example given with the libray here , the Sub sr_Results is executed more than once.
I added logs to the begining of the sub and I can notice that its executed in that way :
if here is only one result in Texts , it is run once, while if there are more than 1 result in Texts, the Sub is executed twice.
B4X:
Sub sr_Results(Texts As List)
Log("sr results")
Dim Text As String = "Speech Results:"&CRLF&CRLF
For Each t As String In Texts
Text = Text & ">" & t & CRLF& CRLF
Next
Label1.Text = Text
End Sub
LOGS :
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
end of speech
sr results
sr results
end of speech
sr results
sr results
end of speech
sr results
sr results
end of speech
sr results
** Activity (main) Pause, UserClosed = false **
In my app, I use the sr_Results Sub to do another action that need only to be executed once per click on button, exactlty like in the app example.
How can I get the SR_Results Sub to be run only once ? (even if there a more than one results in the results, is can be kept in the list, I just want to use Texts.get(0) as the best match for my app).
I hope my request is enough easy to understand!
Thank you for your help an advice.