gotev / android-speech

Android speech recognition and text to speech made easy
http://gotev.github.io/android-speech/
Apache License 2.0
477 stars 156 forks source link

Languages support #7

Closed georgethomas2015e closed 7 years ago

georgethomas2015e commented 7 years ago

Can it be used to recognise different languages, Like i speak in one language and by using the text i get from it i translate it to other language using google translate api , basically want to build something similar to google translate app, speech to speech translation and i am using following algorithm

record sound from microphone, encode it to flac format, send it to google for recognition via speech API, when you receive the answer, translate it by google translate API to desired language, after translation, convert the translated text to speech, you could use Google speech API for that

gotev commented 7 years ago

You can start the speech recognition in the language you want. Just invoke setLocale before starting the speech recognition. Then, you can do all the rest you described in the callback where you get the text. By default, the device's locale is set.

georgethomas2015e commented 7 years ago

But set Locale has very limited number of languages in the list , like for example it do not have spanish in it.

Using your code i speak in spanish it returns me the text , can i use that text directly to translate to desired language Please guide me man m in a real trouble

gotev commented 7 years ago

Locale has all the locales and languages supported by Android, although not every option is listed as a constant. Take a look here. After you get the text from the speech recognizer, is up to you to send it to the translation service (e.g. Google Translate) and receive the response. Performing translations is out of scope regarding this library.

n-droidev commented 2 years ago

Library ignores setLocale for recognition.. It applies to text to speech engine only.. in code you apply it to speechRecognitonEngine too but it doesnt take effect.. What is problem ? I setLocale before invoking startListening method.. it only recognizes speech in english..

gotev commented 2 years ago

Maybe the language you are setting is not supported on the combination of android version/vendor/Google support. Library only wraps system services.

n-droidev commented 2 years ago

Doesnt it support Russian, Turkish, Spanish, Italian, French ? None of them works (