From 62788e9b48f884a35b89c88911b581daa6a14e08 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Thu, 2 Jul 2009 16:29:30 -0700 Subject: [PATCH] Unhide android.speech.tts.TextToSpeech --- api/current.xml | 338 ++++++++++++++++++ .../java/android/speech/tts/TextToSpeech.java | 97 +---- 2 files changed, 340 insertions(+), 95 deletions(-) diff --git a/api/current.xml b/api/current.xml index 7faca03c7a310..bedec9072c724 100644 --- a/api/current.xml +++ b/api/current.xml @@ -109109,6 +109109,344 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + params) - { - synchronized (mStartLock) { - Log.i("TTS received: ", ipaText); - if (!mStarted) { - return TTS_ERROR; - } - try { - // TODO support extra parameters, passing cache of current parameters for the moment - mITts.speakIpa(ipaText, queueMode, mCachedParams); - return TTS_SUCCESS; - } catch (RemoteException e) { - // TTS died; restart it. - mStarted = false; - initTts(); - } catch (NullPointerException e) { - // TTS died; restart it. - mStarted = false; - initTts(); - } catch (IllegalStateException e) { - // TTS died; restart it. - mStarted = false; - initTts(); - } - return TTS_ERROR; - } - } - - /** * Plays the earcon using the specified queueing mode and parameters. * @@ -755,48 +706,4 @@ public class TextToSpeech { } } - - /** - * Synthesizes the given IPA text to a file using the specified parameters. - * - * @param text - * The String of text that should be synthesized - * @param params - * A hashmap of parameters. - * @param filename - * The string that gives the full output filename; it should be - * something like "/sdcard/myappsounds/mysound.wav". - * - * @return Code indicating success or failure. See TTS_ERROR and TTS_SUCCESS. - * - * {@hide} - */ - public int synthesizeIpaToFile(String ipaText, - HashMap params, String filename) { - synchronized (mStartLock) { - if (!mStarted) { - return TTS_ERROR; - } - try { - // TODO support extra parameters, passing null for the moment - if (mITts.synthesizeIpaToFile(ipaText, null, filename)){ - return TTS_SUCCESS; - } - } catch (RemoteException e) { - // TTS died; restart it. - mStarted = false; - initTts(); - } catch (NullPointerException e) { - // TTS died; restart it. - mStarted = false; - initTts(); - } catch (IllegalStateException e) { - // TTS died; restart it. - mStarted = false; - initTts(); - } - return TTS_ERROR; - } - } - }