|
@@ -119,7 +119,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
@Override
|
|
@Override
|
|
|
public void onRangeStart(String utteranceId, int start, int end, int frame) {
|
|
public void onRangeStart(String utteranceId, int start, int end, int frame) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
- if (lastUtterance != null && Integer.parseInt(utteranceId) == lastUtterance.id) {
|
|
|
|
|
|
|
+ if (lastUtterance != null && Long.parseLong(utteranceId) == lastUtterance.id) {
|
|
|
lastUtterance.offset = start;
|
|
lastUtterance.offset = start;
|
|
|
GodotLib.ttsCallback(EVENT_BOUNDARY, lastUtterance.id, start + lastUtterance.start);
|
|
GodotLib.ttsCallback(EVENT_BOUNDARY, lastUtterance.id, start + lastUtterance.start);
|
|
|
}
|
|
}
|
|
@@ -132,7 +132,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
@Override
|
|
@Override
|
|
|
public void onStop(String utteranceId, boolean interrupted) {
|
|
public void onStop(String utteranceId, boolean interrupted) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
- if (lastUtterance != null && !paused && Integer.parseInt(utteranceId) == lastUtterance.id) {
|
|
|
|
|
|
|
+ if (lastUtterance != null && !paused && Long.parseLong(utteranceId) == lastUtterance.id) {
|
|
|
GodotLib.ttsCallback(EVENT_CANCEL, lastUtterance.id, 0);
|
|
GodotLib.ttsCallback(EVENT_CANCEL, lastUtterance.id, 0);
|
|
|
speaking = false;
|
|
speaking = false;
|
|
|
updateTTS();
|
|
updateTTS();
|
|
@@ -146,7 +146,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
@Override
|
|
@Override
|
|
|
public void onStart(String utteranceId) {
|
|
public void onStart(String utteranceId) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
- if (lastUtterance != null && lastUtterance.start == 0 && Integer.parseInt(utteranceId) == lastUtterance.id) {
|
|
|
|
|
|
|
+ if (lastUtterance != null && lastUtterance.start == 0 && Long.parseLong(utteranceId) == lastUtterance.id) {
|
|
|
GodotLib.ttsCallback(EVENT_START, lastUtterance.id, 0);
|
|
GodotLib.ttsCallback(EVENT_START, lastUtterance.id, 0);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -158,7 +158,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
@Override
|
|
@Override
|
|
|
public void onDone(String utteranceId) {
|
|
public void onDone(String utteranceId) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
- if (lastUtterance != null && !paused && Integer.parseInt(utteranceId) == lastUtterance.id) {
|
|
|
|
|
|
|
+ if (lastUtterance != null && !paused && Long.parseLong(utteranceId) == lastUtterance.id) {
|
|
|
GodotLib.ttsCallback(EVENT_END, lastUtterance.id, 0);
|
|
GodotLib.ttsCallback(EVENT_END, lastUtterance.id, 0);
|
|
|
speaking = false;
|
|
speaking = false;
|
|
|
updateTTS();
|
|
updateTTS();
|
|
@@ -172,7 +172,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
@Override
|
|
@Override
|
|
|
public void onError(String utteranceId, int errorCode) {
|
|
public void onError(String utteranceId, int errorCode) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
- if (lastUtterance != null && !paused && Integer.parseInt(utteranceId) == lastUtterance.id) {
|
|
|
|
|
|
|
+ if (lastUtterance != null && !paused && Long.parseLong(utteranceId) == lastUtterance.id) {
|
|
|
GodotLib.ttsCallback(EVENT_CANCEL, lastUtterance.id, 0);
|
|
GodotLib.ttsCallback(EVENT_CANCEL, lastUtterance.id, 0);
|
|
|
speaking = false;
|
|
speaking = false;
|
|
|
updateTTS();
|
|
updateTTS();
|
|
@@ -186,7 +186,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
@Override
|
|
@Override
|
|
|
public void onError(String utteranceId) {
|
|
public void onError(String utteranceId) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
- if (lastUtterance != null && !paused && Integer.parseInt(utteranceId) == lastUtterance.id) {
|
|
|
|
|
|
|
+ if (lastUtterance != null && !paused && Long.parseLong(utteranceId) == lastUtterance.id) {
|
|
|
GodotLib.ttsCallback(EVENT_CANCEL, lastUtterance.id, 0);
|
|
GodotLib.ttsCallback(EVENT_CANCEL, lastUtterance.id, 0);
|
|
|
speaking = false;
|
|
speaking = false;
|
|
|
updateTTS();
|
|
updateTTS();
|
|
@@ -222,7 +222,7 @@ public class GodotTTS extends UtteranceProgressListener implements TextToSpeech.
|
|
|
/**
|
|
/**
|
|
|
* Adds an utterance to the queue.
|
|
* Adds an utterance to the queue.
|
|
|
*/
|
|
*/
|
|
|
- public void speak(String text, String voice, int volume, float pitch, float rate, int utterance_id, boolean interrupt) {
|
|
|
|
|
|
|
+ public void speak(String text, String voice, int volume, float pitch, float rate, long utterance_id, boolean interrupt) {
|
|
|
synchronized (lock) {
|
|
synchronized (lock) {
|
|
|
if (state != INIT_STATE_SUCCESS) {
|
|
if (state != INIT_STATE_SUCCESS) {
|
|
|
return;
|
|
return;
|