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
15 changes: 9 additions & 6 deletions source/speech/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,15 @@ def _removeCompletedFromQueue(self, index):
return False, False
for seqIndex, seq in enumerate(self._curPriQueue.pendingSequences):
lastCommand = seq[-1] if isinstance(seq, list) else None
if isinstance(lastCommand, IndexCommand) and index >= lastCommand.index:
endOfUtterance = isinstance(self._curPriQueue.pendingSequences[seqIndex + 1][0], EndUtteranceCommand)
if endOfUtterance:
# Remove the EndUtteranceCommand as well.
seqIndex += 1
break # Found it!
if isinstance(lastCommand, IndexCommand):
if index > lastCommand.index:
log.debugWarning(f"Reached speech index {index :d}, but index {lastCommand.index :d} never handled")
elif index == lastCommand.index:
endOfUtterance = isinstance(self._curPriQueue.pendingSequences[seqIndex + 1][0], EndUtteranceCommand)
if endOfUtterance:
# Remove the EndUtteranceCommand as well.
seqIndex += 1
break # Found it!
else:
# Unknown index. Probably from a previous utterance which was cancelled.
return False, False
Expand Down