diff options
author | Charles Chen <clchen@google.com> | 2009-07-02 17:21:22 -0700 |
---|---|---|
committer | Charles Chen <clchen@google.com> | 2009-07-02 17:21:22 -0700 |
commit | 4bca97ecaf04c50d5ed49920d119f9ffa6c29402 (patch) | |
tree | 4a0f3271a3cda32160565e9c338d33c00b682489 /packages/TtsService/src/android/tts/TtsService.java | |
parent | b29f8283d06c2ab4eb54c991d7ffb5181d91af15 (diff) | |
download | frameworks_base-4bca97ecaf04c50d5ed49920d119f9ffa6c29402.zip frameworks_base-4bca97ecaf04c50d5ed49920d119f9ffa6c29402.tar.gz frameworks_base-4bca97ecaf04c50d5ed49920d119f9ffa6c29402.tar.bz2 |
Removing IPA - IPA is already handled by the phoneme tag.
Diffstat (limited to 'packages/TtsService/src/android/tts/TtsService.java')
-rwxr-xr-x | packages/TtsService/src/android/tts/TtsService.java | 120 |
1 files changed, 3 insertions, 117 deletions
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java index b5f5b37..5c0c55c 100755 --- a/packages/TtsService/src/android/tts/TtsService.java +++ b/packages/TtsService/src/android/tts/TtsService.java @@ -48,11 +48,9 @@ public class TtsService extends Service implements OnCompletionListener { private static class SpeechItem { public static final int TEXT = 0; - public static final int IPA = 1; - public static final int EARCON = 2; - public static final int SILENCE = 3; - public static final int TEXT_TO_FILE = 5; - public static final int IPA_TO_FILE = 6; + public static final int EARCON = 1; + public static final int SILENCE = 2; + public static final int TEXT_TO_FILE = 3; public String mText = null; public ArrayList<String> mParams = null; public int mType = TEXT; @@ -327,28 +325,6 @@ public class TtsService extends Service implements OnCompletionListener { } /** - * Speaks the given IPA text using the specified queueing mode and parameters. - * - * @param ipaText - * The IPA text that should be spoken - * @param queueMode - * 0 for no queue (interrupts all previous utterances), 1 for - * queued - * @param params - * An ArrayList of parameters. This is not implemented for all - * engines. - */ - private void speakIpa(String ipaText, int queueMode, ArrayList<String> params) { - if (queueMode == 0) { - stop(); - } - mSpeechQueue.add(new SpeechItem(ipaText, params, SpeechItem.IPA)); - if (!mIsSpeaking) { - processSpeechQueue(); - } - } - - /** * Plays the earcon using the specified queueing mode and parameters. * * @param earcon @@ -617,8 +593,6 @@ public class TtsService extends Service implements OnCompletionListener { } else if (currentSpeechItem.mType == SpeechItem.TEXT_TO_FILE) { synthToFileInternalOnly(currentSpeechItem.mText, currentSpeechItem.mParams, currentSpeechItem.mFilename); - } else if (currentSpeechItem.mType == SpeechItem.IPA) { - // TODO Implement IPA support } else { // This is either silence or an earcon that was missing silence(currentSpeechItem.mDuration); @@ -714,51 +688,6 @@ public class TtsService extends Service implements OnCompletionListener { return true; } - /** - * Synthesizes the given IPA text to a file using the specified parameters. - * - * @param ipaText - * The String of IPA text that should be synthesized - * @param params - * An ArrayList of parameters. The first element of this array - * controls the type of voice to use. - * @param filename - * The string that gives the full output filename; it should be - * something like "/sdcard/myappsounds/mysound.wav". - * @return A boolean that indicates if the synthesis succeeded - */ - private boolean synthesizeIpaToFile(String ipaText, ArrayList<String> params, - String filename, boolean calledFromApi) { - // Only stop everything if this is a call made by an outside app trying - // to - // use the API. Do NOT stop if this is a call from within the service as - // clearing the speech queue here would be a mistake. - if (calledFromApi) { - stop(); - } - Log.i("TTS", "Synthesizing IPA to " + filename); - boolean synthAvailable = false; - try { - synthAvailable = synthesizerLock.tryLock(); - if (!synthAvailable) { - return false; - } - // Don't allow a filename that is too long - if (filename.length() > MAX_FILENAME_LENGTH) { - return false; - } - // TODO: Add nativeSynth.synthesizeIpaToFile(text, filename); - } finally { - // This check is needed because finally will always run; even if the - // method returns somewhere in the try block. - if (synthAvailable) { - synthesizerLock.unlock(); - } - } - Log.i("TTS", "Completed synthesis for " + filename); - return true; - } - @Override public IBinder onBind(Intent intent) { if (ACTION.equals(intent.getAction())) { @@ -805,27 +734,6 @@ public class TtsService extends Service implements OnCompletionListener { } /** - * Speaks the given IPA text using the specified queueing mode and - * parameters. - * - * @param ipaText - * The IPA text that should be spoken - * @param queueMode - * 0 for no queue (interrupts all previous utterances), 1 for - * queued - * @param params - * An ArrayList of parameters. The first element of this - * array controls the type of voice to use. - */ - public void speakIpa(String ipaText, int queueMode, String[] params) { - ArrayList<String> speakingParams = new ArrayList<String>(); - if (params != null) { - speakingParams = new ArrayList<String>(Arrays.asList(params)); - } - mSelf.speakIpa(ipaText, queueMode, speakingParams); - } - - /** * Plays the earcon using the specified queueing mode and parameters. * * @param earcon @@ -1014,28 +922,6 @@ public class TtsService extends Service implements OnCompletionListener { return mSelf.synthesizeToFile(text, speakingParams, filename); } - /** - * Synthesizes the given IPA text to a file using the specified - * parameters. - * - * @param ipaText - * The String of IPA text that should be synthesized - * @param params - * An ArrayList of parameters. The first element of this - * array controls the type of voice to use. - * @param filename - * The string that gives the full output filename; it should - * be something like "/sdcard/myappsounds/mysound.wav". - * @return A boolean that indicates if the synthesis succeeded - */ - public boolean synthesizeIpaToFile(String ipaText, String[] params, - String filename) { - ArrayList<String> speakingParams = new ArrayList<String>(); - if (params != null) { - speakingParams = new ArrayList<String>(Arrays.asList(params)); - } - return mSelf.synthesizeIpaToFile(ipaText, speakingParams, filename, true); - } }; } |