summaryrefslogtreecommitdiffstats
path: root/core/java/android/speech
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2009-07-02 16:29:30 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2009-07-02 16:29:30 -0700
commit62788e9b48f884a35b89c88911b581daa6a14e08 (patch)
treeae687ac953c90021882bdbec348edfe58b79ae07 /core/java/android/speech
parentd23d7f2d12c20314e1e8ff206fafc8f21745ca2d (diff)
downloadframeworks_base-62788e9b48f884a35b89c88911b581daa6a14e08.zip
frameworks_base-62788e9b48f884a35b89c88911b581daa6a14e08.tar.gz
frameworks_base-62788e9b48f884a35b89c88911b581daa6a14e08.tar.bz2
Unhide android.speech.tts.TextToSpeech
Diffstat (limited to 'core/java/android/speech')
-rwxr-xr-xcore/java/android/speech/tts/TextToSpeech.java97
1 files changed, 2 insertions, 95 deletions
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java
index 714429d..f714dd9 100755
--- a/core/java/android/speech/tts/TextToSpeech.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -31,11 +31,10 @@ import java.util.Locale;
/**
*
- * Synthesizes speech from text.
+ * Synthesizes speech from text for immediate playback or to create a sound file.
*
- * {@hide}
*/
-//TODO #TTS# review + complete javadoc + add links to constants
+//TODO complete javadoc + add links to constants
public class TextToSpeech {
/**
@@ -370,54 +369,6 @@ public class TextToSpeech {
/**
- * Speaks the IPA string using the specified queuing strategy and speech
- * parameters. Note that the speech parameters are not universally supported
- * by all engines and will be treated as a hint. The TTS library will try to
- * fulfill these parameters as much as possible, but there is no guarantee
- * that the voice used will have the properties specified.
- *
- * @param ipaText
- * The string of IPA text to be spoken.
- * @param queueMode
- * The queuing strategy to use.
- * See TTS_QUEUE_ADD and TTS_QUEUE_FLUSH.
- * @param params
- * The hashmap of speech parameters to be used.
- *
- * @return Code indicating success or failure. See TTS_ERROR and TTS_SUCCESS.
- *
- * {@hide}
- */
- public int speakIpa(String ipaText, int queueMode, HashMap<String,String> 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.
*
* @param earcon
@@ -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<String,String> 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;
- }
- }
-
}