![]() ![]() ![]() Int result = tLanguage(spanishLocale) Ĭase TextToSpeech.LANG_AVAILABLE: // fall-through intentionalĬase TextToSpeech.LANG_COUNTRY_VAR_AVAILABLE:Ĭase TextToSpeech. make sure the spanish local is availableĪssert(ntains(spanishLocale)) Log.i(TAG,"Local available: " + locale.toString()) įinal Locale spanishLocale = new Locale("es", "ES") Set availableSet = spanishTTS.getAvailableLanguages() Get the set of available languages and log them SpanishTTS = new TextToSpeech(this, this) Protected void onActivityResult(int requestCode, int resultCode, Intent data) Toast.makeText(this, "Spanish TTS is not available.", Toast.LENGTH_LONG).show() SpanishTTS.speak(speech, TextToSpeech.QUEUE_FLUSH, null, "") StartActivityForResult(ttsDataAvailIntent, _VOICE_DATA_PASS) Intent ttsDataAvailIntent = new Intent() Hi, in this post we will present how to do speech to text both in Spanish and English using the state of the art for the task (wav2vec v2). make sure Text To Speech Data is available. Public void onCreate(Bundle savedInstanceState)īutton speakButton = (Button)findViewById(R.id.speak_button) Public class MainActivity extends Activity implements View.OnClickListener, TextToSpeech.OnInitListener (Please note: This code has been updated to check the return values of setLanguage in a switch to make sure the language really was set correctly - and it is) package Therefore, the code won't play the voice if this isn't installed, so the fact I hear anything at all means the code believes it is "speaking in Spanish". In the method "onInit()" (a callback which runs as soon as the Engine is loaded) I have asserted that the Locale for Spain exists. The code seems to think the text to speech engine is installed, and speech is synthesized, but with the error mentioned above. Here is a minimal version of my code which produces this error. ![]() I can understand it, but all the Spanish vowel sounds and a few consonants (like the fact that "h" isn't pronounced) are wrong. This means the voice synthesizer being used is an English one (happens to be female). The English voice it uses means that "hola mundo" sounds like "howlaa mundow", as if an English person was trying to say the letters. (a) Why isn't it in a Spanish "voice", and (b) If my code isn't correct, what more do I need to do to make it speak with a Spanish voice. The problem: In Android, when I set the language for Google text to speech to Spanish, the spoken text is with an English voice. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |