Merge "Removing logs of text that is being spoken."
This commit is contained in:
@@ -496,7 +496,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
||||
* engines.
|
||||
*/
|
||||
private int speak(String callingApp, String text, int queueMode, ArrayList<String> params) {
|
||||
Log.v(SERVICE_TAG, "TTS service received " + text);
|
||||
// Log.v(SERVICE_TAG, "TTS service received " + text);
|
||||
if (queueMode == TextToSpeech.QUEUE_FLUSH) {
|
||||
stop(callingApp);
|
||||
} else if (queueMode == 2) {
|
||||
@@ -705,27 +705,27 @@ public class TtsService extends Service implements OnCompletionListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void onCompletion(MediaPlayer arg0) {
|
||||
// mCurrentSpeechItem may become null if it is stopped at the same
|
||||
// time it completes.
|
||||
SpeechItem currentSpeechItemCopy = mCurrentSpeechItem;
|
||||
if (currentSpeechItemCopy != null) {
|
||||
String callingApp = currentSpeechItemCopy.mCallingApp;
|
||||
ArrayList<String> params = currentSpeechItemCopy.mParams;
|
||||
String utteranceId = "";
|
||||
if (params != null) {
|
||||
for (int i = 0; i < params.size() - 1; i = i + 2) {
|
||||
String param = params.get(i);
|
||||
if (param.equals(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID)) {
|
||||
utteranceId = params.get(i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utteranceId.length() > 0) {
|
||||
dispatchUtteranceCompletedCallback(utteranceId, callingApp);
|
||||
}
|
||||
}
|
||||
processSpeechQueue();
|
||||
public void onCompletion(MediaPlayer arg0) {
|
||||
// mCurrentSpeechItem may become null if it is stopped at the same
|
||||
// time it completes.
|
||||
SpeechItem currentSpeechItemCopy = mCurrentSpeechItem;
|
||||
if (currentSpeechItemCopy != null) {
|
||||
String callingApp = currentSpeechItemCopy.mCallingApp;
|
||||
ArrayList<String> params = currentSpeechItemCopy.mParams;
|
||||
String utteranceId = "";
|
||||
if (params != null) {
|
||||
for (int i = 0; i < params.size() - 1; i = i + 2) {
|
||||
String param = params.get(i);
|
||||
if (param.equals(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID)) {
|
||||
utteranceId = params.get(i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (utteranceId.length() > 0) {
|
||||
dispatchUtteranceCompletedCallback(utteranceId, callingApp);
|
||||
}
|
||||
}
|
||||
processSpeechQueue();
|
||||
}
|
||||
|
||||
private int playSilence(String callingApp, long duration, int queueMode,
|
||||
@@ -1064,7 +1064,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
||||
SoundResource sr = getSoundResource(mCurrentSpeechItem);
|
||||
// Synth speech as needed - synthesizer should call
|
||||
// processSpeechQueue to continue running the queue
|
||||
Log.v(SERVICE_TAG, "TTS processing: " + mCurrentSpeechItem.mText);
|
||||
// Log.v(SERVICE_TAG, "TTS processing: " + mCurrentSpeechItem.mText);
|
||||
if (sr == null) {
|
||||
if (mCurrentSpeechItem.mType == SpeechItem.TEXT) {
|
||||
mCurrentSpeechItem = splitCurrentTextIfNeeded(mCurrentSpeechItem);
|
||||
@@ -1462,8 +1462,8 @@ public class TtsService extends Service implements OnCompletionListener {
|
||||
*
|
||||
* @return SUCCESS or ERROR as defined in android.speech.tts.TextToSpeech.
|
||||
*/
|
||||
public int setEngineByPackageName(String packageName) {
|
||||
return mSelf.setEngine(packageName);
|
||||
public int setEngineByPackageName(String packageName) {
|
||||
return mSelf.setEngine(packageName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user