I am following all the steps in my Activity to check whether the TTS
is available before call speak(). I see the following in my LogCat
which seems fine. But it's simply silent, no voice spoken. I also
tried it on my Nexus One, with the TTS enabled in settings.
Would appreciate if somebody would shed some light on what could be
the issue. Thnx.
01-27 21:30:40.178: INFO/ActivityManager(60): Starting activity:
Intent { act=android.speech.tts.engine.CHECK_TTS_DATA
cmp=com.svox.pico/.CheckVoiceData }
01-27 21:30:40.688: ERROR/Arthur -(279): Device HAVE TTS enabled.
Instantiated TTS Object.
01-27 21:30:45.771: WARN/WindowManager(60): Key dispatching timed out
sending to <null>
01-27 21:30:45.788: WARN/WindowManager(60): Dispatch state: {{KeyEvent
{action=1 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to Window
{43d19c58 com.arthur.views/com.arthur.views.TextDisplay paused=false}
@ 1264645670452 lw=Window{43d19c58 com.arthur.views/
com.arthur.views.TextDisplay paused=false}
lb=android.os.binderpr...@43d831c0 fin=false gfw=true ed=true tts=0
wf=false fp=false mcf=null}}
01-27 21:30:45.808: INFO/WindowManager(60): focus null mToken is null
at event dispatch!
01-27 21:30:45.817: WARN/WindowManager(60): Current state: {{KeyEvent
{action=0 code=82 repeat=0 meta=0 scancode=229 mFlags=8} to null @
1264645845807 lw=null lb=null fin=true gfw=true ed=true tts=0 wf=false
fp=false mcf=null}}
01-27 21:30:45.817: WARN/WindowManager(60): Continuing to wait for key
to be dispatched
01-27 21:30:46.459: VERBOSE/TtsService(263): TtsService.onCreate()
01-27 21:30:46.498: VERBOSE/TtsService(263): TTS is loading /system/
lib/libttspico.so
01-27 21:30:46.599: VERBOSE/SynthProxy(263): AudioTrack started
01-27 21:30:46.628: VERBOSE/TtsService(263): TtsService.setLanguage
(eng, USA, )
01-27 21:30:46.740: INFO/SVOX Pico Engine(263): loaded en-US
successfully
01-27 21:30:46.749: INFO/SynthProxy(263): setting speech rate to 100
01-27 21:30:50.312: WARN/ActivityManager(60): Launch timeout has
expired, giving up wake lock!
01-27 21:30:50.459: INFO/TTS received:(279): I love you
Here's the code:
private void checkTTS()
{
Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, MY_TTS_CHECK_CODE);
}
protected void onActivityResult(int requestCode, int resultCode,
Intent data)
{
if (requestCode == MY_TTS_CHECK_CODE) {
if (resultCode ==
TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
Log.e(ViewsMenu.debugTag, "Device HAVE TTS enabled.
Instantiated TTS Object.");
// success, create the TTS instance
mTts = new TextToSpeech(this, this);
mTts.speak("I love you", TextToSpeech.QUEUE_FLUSH, null);
} else {
// missing data, install it
Log.e(ViewsMenu.debugTag, "Device doesn't have TTS
enabled");
/*
Intent installIntent = new Intent();
installIntent.setAction(
TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
*/
}
}
}
public void onInit(int status)
{
Log.e(ViewsMenu.debugTag, "Calling OnInit()");
}
public void onDestroy()
{
mTts.shutdown();
Log.e(ViewsMenu.debugTag, "Calling onDestroy()");
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en