I have an app for low vision people that is heavily dependent on TTS. However, for some reason, when I use the talk method, TTS randomly skips the first few letters of the sentence or says the first few letters in the top volume, and the rest in normal volume.
Any idea why this might happen?
This is my current code:
public class SpeechHelper implements TextToSpeech.OnInitListener { private Context context = null; private TextToSpeech tts; public SpeechHelper(Context context) { this.context = context; try { tts = new TextToSpeech(context, this); } catch(Exception e) { Log.e("Phone Features Exception","Couldn't initiate TTS", e); } } @Override public void onInit(int status) { if (status == TextToSpeech.SUCCESS) { tts.setLanguage(Locale.getDefault()); } } public void speak(String s, int mode, String messageID) { Log.d("VOLUME", "getStreamVolume " + am.getStreamVolume(AudioManager.STREAM_MUSIC));
I noticed that the problem always occurs in the next 5 seconds after making a call or when unlocking the phone in the application.
source share