The Android SDK support an easy integration of speech input into native applications. We need just to send out an intent RecognizerIntent (no permission is required) to call any available voice recognition service in the phone (e.g. Google Voice, Nuance Dragon API for mobile). Then, a list of recognized word is send back to the application which can capture them in the onActivityResult method. Here is how to send the RecognizerIntent:
DroidTranslator
As an example of using speech as user input I made an Android
application that translator the user voice message from a language to
another. The project is open source, this is link to the project GitHub repository. The following snapshot of the application was taken with Android Screencast.
I used the MyMemory language translation service, but there is planty of similar service, here is some available translation API:
Here is a demo of the application:
int REQUEST_CODE = 1234; Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Transalation Demo..."); startActivityForResult(intent, REQUEST_CODE);The next code snippet shows how to handle the callback message in the onActivityResult method:
@Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { ArrayList<String> matches = intent.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); String text = matches.get(0); String translated = translate(text); if(translated != null) { Toast.makeText(this, translated, Toast.LENGTH_LONG).show(); }else { Toast.makeText(this, "Unable to contact translation service", Toast.LENGTH_LONG).show(); } } super.onActivityResult(requestCode, resultCode, intent); }The two snippets were inspired from other interesting posts that can be found hereor here. The Google official post on how to use Speech Input in Android through Google's Voice Search application can be found here.
DroidTranslator
As an example of using speech as user input I made an Android
application that translator the user voice message from a language to
another. The project is open source, this is link to the project GitHub repository. The following snapshot of the application was taken with Android Screencast.I used the MyMemory language translation service, but there is planty of similar service, here is some available translation API:
- Google Translate API a paid service, a Java wrapper for this API can be found here.
- Microsoft Translator APIs a free service for less than 2M translated charater per month, similarly a Java wrapper can be found here.
- Mygengo Translation API.a RESTful api with OAuth
- Speaklite Translate API. a professional service.
- WebServiceX.Net Translation Engine a web service accessible via SOAP and XML.An example of how to use this service can be found here Translation Web Service Java Tutorial .
- MyMemory service is a human made translations database, it provides a free to use API.
Here is a demo of the application:
Well you use a hard way for publishing, you could find much easier one!
RépondreSupprimerClick here:
angularjs training in btm
Click here:
angularjs training in rajajinagar
Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
RépondreSupprimerBlueprism online training
Blue Prism Training in Pune
Blueprism training in tambaram
Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
RépondreSupprimerDevops Training in Chennai
Devops Training in Bangalore
Well done! Pleasant post! This truly helps me to discover the solutions for my inquiry. Trusting, that you will keep posting articles having heaps of valuable data. You're the best!
RépondreSupprimerjava training in marathahalli | java training in btm layout
java training in jayanagar | java training in electronic city
Really great post, I simply unearthed your site and needed to say that I have truly appreciated perusing your blog entries.
RépondreSupprimerData Science training in rajaji nagar | Data Science with Python training in chenni
Data Science training in electronic city | Data Science training in USA
Data science training in pune | Data science training in kalyan nagar
After seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
RépondreSupprimerangularjs-Training in tambaram
angularjs-Training in sholinganallur
angularjs-Training in velachery
angularjs Training in bangalore
angularjs Training in bangalore
angularjs Training in btm
After reading your post I understood that last week was with full of surprises and happiness for you. Congratz! Even though the website is work related, you can update small events in your life and share your happiness with us too.
RépondreSupprimerangularjs online training
apache spark online training
informatica mdm online training
devops online training
aws online training
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
RépondreSupprimerMicrosoft Azure online training
Selenium online training
Java online training
Python online training
uipath online training
excellent one..nice,creative..Thanks for the Giving the Good content to making valuable more. Appreciating all of your efforts to giving such an informative Blogs.
RépondreSupprimerBEST ANGULAR JS TRAINING IN CHENNAI WITH PLACEMENT
https://www.acte.in/angular-js-training-in-chennai
https://www.acte.in/angular-js-training-in-annanagar
https://www.acte.in/angular-js-training-in-omr
https://www.acte.in/angular-js-training-in-porur
https://www.acte.in/angular-js-training-in-tambaram
https://www.acte.in/angular-js-training-in-velachery
very nice one
RépondreSupprimerBEST ANGULAR JS TRAINING IN CHENNAI WITH PLACEMENT
https://www.acte.in/angular-js-training-in-chennai
https://www.acte.in/angular-js-training-in-annanagar
https://www.acte.in/angular-js-training-in-omr
https://www.acte.in/angular-js-training-in-porur
https://www.acte.in/angular-js-training-in-tambaram
https://www.acte.in/angular-js-training-in-velachery
excellent one and nice creative.
RépondreSupprimerAngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery
thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
RépondreSupprimerpython training in chennai
python course in chennai
python online training in chennai
python training in bangalore
python training in hyderabad
python online training
python training
python flask training
python flask online training
python training in coimbatore
I am so proud of you and your efforts and work make me realize that anything can be done with patience and sincerity. Well I am here to say that your work has inspired me without a doubt.
RépondreSupprimeroracle training in chennai
oracle training in tambaram
oracle dba training in chennai
oracle dba training in tambaram
ccna training in chennai
ccna training in tambaram
seo training in chennai
seo training in tambaram
Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
RépondreSupprimeroracle training in chennai
oracle training in omr
oracle dba training in chennai
oracle dba training in omr
ccna training in chennai
ccna training in omr
seo training in chennai
seo training in omr
After seeing your article I want to say that the presentation is very good and also a well-written article with some very good information which is very useful for the readers....thanks for sharing it and do share more posts like this.
RépondreSupprimerWeb design Training in Chennai
Web design Training in Velachery
Web design Training in Tambaram
Web design Training in Porur
Web design Training in Omr
Web design Training in Annanagar