Android Question Voice input button

Rusty

Well-Known Member
Licensed User
Longtime User
On some keyboards there is a voice input button.
When one uses this button, is there an event that fires where you can get the resultant text?
This is not a programmatic speech-to-text, this is a function of the OS/keyboard.
Thanks,
Rusty
 

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Erel,
Adding my own button can work well, but when the keyboard has a microphone on it, it seems to run the same OS VR code, but the events on your example, of course, don't fire with the keyboard invoked VR.
Is there a way to get events from the microphone button on the soft keyboard?
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks.
In your example, I have implemented the SpeakButton Custom into my program and I am now receiving:
Error occurred on line: 26 (speakbutton)
java.lang.RuntimeException: Object should first be initialized (EditText).
My edittext is defined in my bal, which is previously loaded:
B4X:
        Activity.LoadLayout("JournalEntry")
        btnSpeak.TargetEditText = edtJournalEntry
Your Speakbutton is being used verbatim...
I get the error in the Speakbutton routine line 26: et.Text = Texts.Get(0)
The vr_result (texts) contains properly transcribed text.
I notice there is an initialize in the SpeakButton bas file, but it is never actually called in your example, should I do this and if so, what are the meanings of TargetModule and EventName? (Main and ???)
Thanks Erel
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I know this, it is in my bal as a custom view (copied from your example).
I load the bal as shown above and then set the btnspeak.targetedittext as above.
then when i click the button and speak, it properly transcribes to text and then it dies on the line indicated above.
For some reason it is acting like my edittext defined in my bal; loaded in Main; is not initialized...or ET in SpeakButton is not initialized
Thanks for your help,
Rusty
 
Upvote 0
Top