Re: [android-developers] Infinite loop in TextToSpeech.initTts

2011-09-21 Thread Nikolay Elenkov
On Tue, Sep 20, 2011 at 6:28 PM, BorisB boris.br...@gmail.com wrote:
 Hi all,

 The device is HTC Wildfire with locale set to Greek.
 NullPointer exception in SetLanguage generates infinite loop in
 initTtts . Relevant portion of log is

 V/TtsService( 7474): TtsService.onCreate()
 E/TtsService( 7474): Invalid TTS Engine Package: com.marvin.espeak
 V/TtsService( 7474): TtsService.setLanguage(ell, , )

Are you calling setEngineByPackageName()? If so, you should check
the return code, and not call setLanguage() if it returns ERROR. Also,
it seems it takes a bit of time to initialize after you call
setEngineByPackageName()
even if it returns SUCCESS.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Infinite loop in TextToSpeech.initTts

2011-09-20 Thread BorisB
Hi all,

The device is HTC Wildfire with locale set to Greek.
NullPointer exception in SetLanguage generates infinite loop in
initTtts . Relevant portion of log is

V/TtsService( 7474): TtsService.onCreate()
E/TtsService( 7474): Invalid TTS Engine Package: com.marvin.espeak
V/TtsService( 7474): TtsService.setLanguage(ell, , )
E/TtsService( 7474): Invalid TTS Engine Package: com.marvin.espeak
E/TextToSpeech.java - setLanguage(12789): NullPointerException
W/System.err(12789): java.lang.NullPointerException
W/System.err(12789):at
android.speech.tts.TextToSpeech.setLanguage(TextToSpeech.java:1069)
W/System.err(12789):at android.speech.tts.TextToSpeech
$1.onServiceConnected(TextToSpeech.java:448)
W/System.err(12789):at android.app.ActivityThread$PackageInfo
$ServiceDispatcher.doConnected(ActivityThread.java:1280)
W/System.err(12789):at android.app.ActivityThread$PackageInfo
$ServiceDispatcher$RunConnection.run(ActivityThread.java:1297)
W/System.err(12789):at
android.os.Handler.handleCallback(Handler.java:587)

and it goes on and on since NullPointerException handler in
setLanguage() calls initTts() which calls setLanguage() etc...


This does not crash the application - eventualy JNI handles got
exhausted and VM crashes (  I'm not sure if these are related ).

Does anybody have similar problems? And what is the solution?
---
Boris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en