Use the TTS queue constants in the TTS service as defined in the
TextToSpeech class.
This commit is contained in:
@@ -319,14 +319,14 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
* @param text
|
* @param text
|
||||||
* The text that should be spoken
|
* The text that should be spoken
|
||||||
* @param queueMode
|
* @param queueMode
|
||||||
* 0 for no queue (interrupts all previous utterances), 1 for
|
* TextToSpeech.TTS_QUEUE_FLUSH for no queue (interrupts all previous utterances),
|
||||||
* queued
|
* TextToSpeech.TTS_QUEUE_ADD for queued
|
||||||
* @param params
|
* @param params
|
||||||
* An ArrayList of parameters. This is not implemented for all
|
* An ArrayList of parameters. This is not implemented for all
|
||||||
* engines.
|
* engines.
|
||||||
*/
|
*/
|
||||||
private int speak(String callingApp, String text, int queueMode, ArrayList<String> params) {
|
private int speak(String callingApp, String text, int queueMode, ArrayList<String> params) {
|
||||||
if (queueMode == 0) {
|
if (queueMode == TextToSpeech.TTS_QUEUE_FLUSH) {
|
||||||
stop(callingApp);
|
stop(callingApp);
|
||||||
}
|
}
|
||||||
mSpeechQueue.add(new SpeechItem(callingApp, text, params, SpeechItem.TEXT));
|
mSpeechQueue.add(new SpeechItem(callingApp, text, params, SpeechItem.TEXT));
|
||||||
@@ -342,15 +342,15 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
* @param earcon
|
* @param earcon
|
||||||
* The earcon that should be played
|
* The earcon that should be played
|
||||||
* @param queueMode
|
* @param queueMode
|
||||||
* 0 for no queue (interrupts all previous utterances), 1 for
|
* TextToSpeech.TTS_QUEUE_FLUSH for no queue (interrupts all previous utterances),
|
||||||
* queued
|
* TextToSpeech.TTS_QUEUE_ADD for queued
|
||||||
* @param params
|
* @param params
|
||||||
* An ArrayList of parameters. This is not implemented for all
|
* An ArrayList of parameters. This is not implemented for all
|
||||||
* engines.
|
* engines.
|
||||||
*/
|
*/
|
||||||
private int playEarcon(String callingApp, String earcon, int queueMode,
|
private int playEarcon(String callingApp, String earcon, int queueMode,
|
||||||
ArrayList<String> params) {
|
ArrayList<String> params) {
|
||||||
if (queueMode == 0) {
|
if (queueMode == TextToSpeech.TTS_QUEUE_FLUSH) {
|
||||||
stop(callingApp);
|
stop(callingApp);
|
||||||
}
|
}
|
||||||
mSpeechQueue.add(new SpeechItem(callingApp, earcon, params, SpeechItem.EARCON));
|
mSpeechQueue.add(new SpeechItem(callingApp, earcon, params, SpeechItem.EARCON));
|
||||||
@@ -408,7 +408,7 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
|
|
||||||
private int playSilence(String callingApp, long duration, int queueMode,
|
private int playSilence(String callingApp, long duration, int queueMode,
|
||||||
ArrayList<String> params) {
|
ArrayList<String> params) {
|
||||||
if (queueMode == 0) {
|
if (queueMode == TextToSpeech.TTS_QUEUE_FLUSH) {
|
||||||
stop(callingApp);
|
stop(callingApp);
|
||||||
}
|
}
|
||||||
mSpeechQueue.add(new SpeechItem(callingApp, duration));
|
mSpeechQueue.add(new SpeechItem(callingApp, duration));
|
||||||
@@ -759,8 +759,8 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
* @param text
|
* @param text
|
||||||
* The text that should be spoken
|
* The text that should be spoken
|
||||||
* @param queueMode
|
* @param queueMode
|
||||||
* 0 for no queue (interrupts all previous utterances), 1 for
|
* TextToSpeech.TTS_QUEUE_FLUSH for no queue (interrupts all previous utterances)
|
||||||
* queued
|
* TextToSpeech.TTS_QUEUE_ADD for queued
|
||||||
* @param params
|
* @param params
|
||||||
* An ArrayList of parameters. The first element of this
|
* An ArrayList of parameters. The first element of this
|
||||||
* array controls the type of voice to use.
|
* array controls the type of voice to use.
|
||||||
@@ -779,8 +779,8 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
* @param earcon
|
* @param earcon
|
||||||
* The earcon that should be played
|
* The earcon that should be played
|
||||||
* @param queueMode
|
* @param queueMode
|
||||||
* 0 for no queue (interrupts all previous utterances), 1 for
|
* TextToSpeech.TTS_QUEUE_FLUSH for no queue (interrupts all previous utterances)
|
||||||
* queued
|
* TextToSpeech.TTS_QUEUE_ADD for queued
|
||||||
* @param params
|
* @param params
|
||||||
* An ArrayList of parameters.
|
* An ArrayList of parameters.
|
||||||
*/
|
*/
|
||||||
@@ -798,8 +798,8 @@ public class TtsService extends Service implements OnCompletionListener {
|
|||||||
* @param duration
|
* @param duration
|
||||||
* The duration of the silence that should be played
|
* The duration of the silence that should be played
|
||||||
* @param queueMode
|
* @param queueMode
|
||||||
* 0 for no queue (interrupts all previous utterances), 1 for
|
* TextToSpeech.TTS_QUEUE_FLUSH for no queue (interrupts all previous utterances)
|
||||||
* queued
|
* TextToSpeech.TTS_QUEUE_ADD for queued
|
||||||
* @param params
|
* @param params
|
||||||
* An ArrayList of parameters.
|
* An ArrayList of parameters.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user