Hello, I need some help with ``Speak/response
.
I want Mycroft to read me some headlines and ask me after each headline if I want detail or next.
My problem is that Mycroft does not wait for a response, but start to read next headline and stop speaking after two words, wait for response, and continue with speaking.
def is_affirmative(self, utterance, lang='en-us'):
affirmatives = ['detail', 'yes', 'sure', 'please do']
for word in affirmatives:
if word in utterance:
return True
return False
def is_next(self, utterance, lang='en-us'):
affirmatives = ['next', 'continue', 'no', 'nope']
for word in affirmatives:
if word in utterance:
return True
return False
for i in range(5):
self.speak(str(entries[i].title),expect_response=False,wait=True)
response = self.get_response("Detail or next", num_retries=0)
if response and self.is_affirmative(response):
self.log.debug("detail")
if response and self.is_next(response):
self.log.debug("next")
If I run speak command it wait only few milliseconds.
09:28:12.159 | DEBUG | 13003 | NewsSkill | 2020-05-02 09:28:12.159477
09:28:12.160 | DEBUG | 13003 | NewsSkill | 2020-05-02 09:28:12.160172