Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Send listen on last sentence of utterance #2351

Merged
merged 2 commits into from
Oct 8, 2019

Conversation

forslund
Copy link
Collaborator

@forslund forslund commented Oct 4, 2019

Description

When self.speak() is called with expect_response=True the speech output system will generate a trigger for the listener. This has been prone to errors when multi-sentence phrases are sent to it triggering the listening between two sentences instead of the end.

This is due to the trigger was set on the audio end message, which could occur mid utterance if a sentence was slow to render and the queue got empty.

This modifies the behaviour attaching the listen trigger to the last chunk only

How to test

Use self.ask_yesno() or get_response from a skill with a multi-sentence dialog and check that the listen is triggered correctly. To simulate a delay add a sleep in the execute method before the playback information is added to the queue (hereish)

Contributor license agreement signed?

CLA [ Yes ]

If rendering a chunk of a sentence takes too long time, the audio queue
may run out and trigger the listening.

This moves the listening trigger to after the last chunk.
@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Oct 4, 2019
@forslund forslund merged commit 88e8b66 into MycroftAI:dev Oct 8, 2019
@forslund forslund deleted the feature/listen-on-last branch November 28, 2019 09:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants