Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,18 @@ private boolean isAssistantPlaying() {
* @see #handleSpeechStarting()
*/
private void handleSpeechCompleted(int status) {
if (!mIsSpeaking) {
// Speech already completed, such as when an interrupt completes the current item and the
// engine then reports that it stopped. Audio focus was released then, and observers told,
// except that a pause that stopped the speech is only known now.
if (status == STATUS_PAUSE) {
for (SpeechController.Observer observer : observers) {
observer.onSpeechPaused();
}
}
return;
}

for (SpeechController.Observer observer : observers) {
if (status == STATUS_PAUSE) {
observer.onSpeechPaused();
Expand All @@ -2242,10 +2254,6 @@ private void handleSpeechCompleted(int status) {
}
}

if (!mIsSpeaking) {
LogUtils.e(TAG, "Completed speech while already completed!");
}

mIsSpeaking = false;
}

Expand Down
Loading