hcooper / snips-tts-polly

Use the AWS Polly text-to-speech service with Snip voice platform
MIT License
8 stars 6 forks source link

sayFinish only after playFinish #2

Closed diplix closed 4 years ago

diplix commented 5 years ago

instead of of finishing the say-session right after firing playBytes, wait and finish after playFinished. also: playBytes @ siteId instead of default

using home-assistant snips.say_action, where snips speaks and then listens to an intent (i.e. a yes/no intent) only works if snips knows when it finished talking. otherwise it listens to itself, instead of the user. this fixes that problem, in a rather crude way (i’m not a programer), by listening to playFinished and then closing the session. my changes can probably be achived in a more elegant way, but this is working for me.

nanosonde commented 4 years ago

@hcooper Do you have any plan to integrate this? It seems that is the proper way of emitting hermes/tts/sayFinished only when the Hermes Audio Server has really finished the playback.

See also: https://docs.snips.ai/reference/hermes#being-notified-when-tts-has-finished-speaking-some-text

Immediately sending back hermes/tts/sayFinished after playback has started causes problems if you have skills which offer dialogues with multiple back and forth between the user and snips.

hcooper commented 4 years ago

Hey, I've not been able to use snips for a while, and the recent news about it's acquisition and feature-killing means I probably won't be touching it again :-( You're welcome to fork and take this over. As part gift I'll just hit "merge" :-)

diplix commented 4 years ago

tnx.