Android Ultimate Plugin tutorial part 5 – Speech to text

Hi everyone, it’s tutorial time again and now we will show you on how to use Speech to text feature and before anything else we want to tell you that this features will only work when there’s an internet connection on  your device else it will just throw an error event.

Permission needed on your Android Manifest file without this it will not work or it will produce an error.

Let’s do it!

Firs step is to get the instance of SpeechPlugin

To stop Debug toast message from showing,  pass 0 on SetDebug method

We need to Initialized it

Next we need to check first if the current device has a support for Speech Recognizer, we can do this check by call this method, if it’s true then its supported else it’s not supported.

After we make sure that Speech Recognizer is supported on your Android Device, we can now setup a Listener for Speech Recognizer Events, by doing this code

And here’s the sample method receivers fro Speech Recognizer Events

 

To Start Listening for Speech Input call this method

To stop listening from Speech Recognizer events call this method

and when you are done using Speech Recognizer Destroy it to release the Speech Recognizer service from Android Device

To  Cancel Speech

To Stop Listening

For Stopping and Cancel

New Feature

Start Listening No Beep

Experiment Features but still not complete to listen and search using web browser

For Reference here’s the code that we used on Speech To Text Demo

Note: you will noticed on this code that Text to Speech is also used, the purposed is only for presentation. Also to make this code run you need Text UI just drag it on this code inspector and Button UI to call Start Listening. 

And there you have it, Speech Recognizer tutorial is done.

Thanks for reading our humble tutorial and Happy Coding 🙂

For questions or comments or suggestions or any feed back just email us at gigadrillgames.com

6 Comments on “Android Ultimate Plugin tutorial part 5 – Speech to text”

  1. in the SpeechPlugin, how can change the language? exists some method simillar to .StartListening (3, “en-US”);

  2. Thanks for this package, it’s really helpful 🙂
    Is there a way to program trigger words ? For example, if I want a message to be displayed in the console (or on the screen) when I say a specific word… Is there a way to do this task?
    Thank you again 🙂

    1. yes you can do this on result events, you just need to check if the words that you want appear there and then just do things that you wanted

Leave a Reply

Your email address will not be published. Required fields are marked *

*