Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log never handled speech indexes, and don't make the speech queue lag behind #9946

Merged
merged 3 commits into from
Jul 19, 2019
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