I try to say the word Minuend in German with Android TTS. But my Phone pronounces the ue as a ü (u-Umlaut). Anyone knows a way to force TTS speaking the ue as an ue?
Best Regards, Thomas.
This was used in ancient times for those typewriters which didn't have the umlauted vowels...
Trick: Try inserting something between the u and the e, like replacing "ue" with "u-e" before reading it.
i.e.:
tts.speak(txt,replace("ue", "u-e"), TextToSpeech.QUEUE_FLUSH, null);
Where txt is your string ("Minuendo") and tts is the TextToSpeech instance.
It should work, because the TTS engine won't recognize the ue as a diphtong anymore.
And "-" won't be read (or use a comma instead or some other MUTE character).
Related
I develop an Android app. If I call
float.Parse("51.552058")
in Editor or App on my Mac Book (Language Setting English), it works fine. After publishing to Android (Language Setting German) the result of the Parse operation is not "51.552058" anymore but "5,155211E+09". I understand that this might be related to the device's language but I still don't really understand what is happening and why.
I also tried following with no success:
float.Parse("51.552058", System.Globalization.NumberStyles.Any)
float.Parse("51.552058", System.Globalization.NumberStyles.AllowDecimalPoint)
Did anyone stumble over this before?
float.Parse is culture dependent.
See e.g. from NumberFormatInfo
// '1,034,562.91' --> 1034562.91 (en-US)
// '1,034,562.91': FormatException (fr-FR)
// '1,034,562.91' --> 1034562.91 (Invariant)
Reason here is that in EU cultures the , is usually the decimal separator while the . is used as the group separator. So from the example above the correct format for fr-FR would be 1.034.562,91
You probably rather want to use CultureInfo.InvariantCulture like
float.Parse("51.552058", CultureInfo.InvariantCulture);
or directly NumberFormatInfo.InvariantInfo
float.Parse("51.552058", NumberFormatInfo.InvariantInfo);
which simply has defined
NumberDecimalSeparator .
NumberGroupSeparator ,
I want to have my phone number to be clickable, right now my current solution:
final SpannableString msg = "Contact us: test#t.t or call: 5008 878 6578"
Linkify.addLinks(msg, Linkify.EMAIL_ADDRESSES | Linkify.PHONE_NUMBERS);
textView.setText(msg);
This works fine for Android 8.1 and below but not for Android 9 (email is clickable so the problem is only with number phone)
I've tried already doing it with XML layouts or with
textView.setAutoLinkMask(Linkify.PHONE_NUMBERS)
And the output is the same, phone number is not clickable.
How to fix it on Android 9?
The mask Linkify.EMAIL_ADDRESSES | Linkify.PHONE_NUMBERS seems correct, according to the documentation - but I would not recognize something alike 5008 878 6578 as a valid phone number - and I definitely could not dial it, if I would click it... so most likely the sPhoneNumberMatchFilter might be at fault.
Manually building the desired Spannable with the tel://50088786578 might be an easy solution; adjusting the sPhoneNumberMatchFilter might be the other option... also .addLinks() permits this, with argument matchFilter.
Are you certain that you are running with the same Locale on Android 9.0? This should be where the regex pattern to match for may come from, because those formats count towards localization.
I want to try speech Gujarati language for my application. I've tried this locale code for the Gujarati language:
result = tts.setLanguage(Locale("gu-IN"))
result = tts.setLanguage(Locale("gu"))
result = tts?.setLanguage(Locale("gu-IND"))!!
I've tried these locale codes for the Gujarati Language .. but none of them work.
The code gu-IN is correct you can confirm by here.
If it's not working in your program then you can try this code to confirm if the language is in the list or not.
If it's available then you need to re-check your code. You can also share your code for help.
I am working on an application in which i would like to use TTS to read text. I want to support Indian Languages offline so i have installed eSpeak Text To Speech engine in my android device and have set it as default. After understanding Speech Synthesis Markup Language (SSML) i realized that i can give phonemes as an input to make the Speech Engine pronounce words correctly. So i created a sample application in which i am using TextToSpeech class of Android.
String text = "[[ D,Is Iz sVm f#n'EtIk t'Ekst 'InpUt ]]";// "This is some phonetic text input"
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
I read in the documentation of espeak that to make the engine understand phonemes, simply put phonetic expression in double square brackets and it would accept it as phoneme and render it accordingly. But this doesn't work in Android. Is the syntax correct?
Thanks
I directly used following code with Punjabi language unicode text in my app and it works.
m_objTTS = new TextToSpeech(this, this, "com.googlecode.eyesfree.espeak");
m_strTexttoSpeak = "ਸਕਰੀਨ ਤੇ ਟੈਪ ਕਰੋ|"; // its punjabi translation for "Tap on Screen"
m_objTTS.speak(m_strTexttoSpeak,TextToSpeech.QUEUE_FLUSH, null, null);
You should have espeak TTS app installed on mobile device and set it as default TTS engine. Default system language set to language of your choice ( Punjabi is set in my case )
Sorry for my poor english... xD
I'm writing some code to use Android's voice search. I have declared an intent like this:
SpeechRecognizer sr;
Intent intent_listener;
intent_listener = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent_listener.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent_listener.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,getPackageName());
intent_listener.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS,0);
sr.startListening(intent_listener);
Then i implemented RecognitionListener class and i put some code onResult method. this work but it's not accurate and sometimes it don'understand simple phrases. it also take a lot to have a result... so i tried with the visible box (that you can normally use to search something on your phone) and that's perfect.
aren't the same thing? why one of them is more accurated then other? am i wrong something with parameters? i'm working with android 4.0.3. thanks a lot to everyone!!
Don't set EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS to 0, rather do not set it at all.
To answer your question, the "visible box" and SpeechRecognizer are not necessarily "the same thing". They can be and probably often are, but there can also be cases where they are implemented by completely different speech recognition providers.