snips-issues icon indicating copy to clipboard operation
snips-issues copied to clipboard

[Feature Request]Call onHotword

Open Psychokiller1888 opened this issue 6 years ago • 10 comments

We need a way to be able to inject code right after the hotword is detected but before the feedback sound is played, to basically be able to stop it or change it

Psychokiller1888 avatar Jun 24 '18 09:06 Psychokiller1888

@Psychokiller1888 would moving the feedback sound handling out of the dialogue and into a separate component be a solution ? I've been toying with the idea for some time (I need to do some test whether that doesn't negatively affect other places in the dialog) This would enable you do disable the built-in feedback compoent and write you own with custom logic

fredszaq avatar Jun 26 '18 16:06 fredszaq

Yep, but letting it by default automatically handeled. The idea would be having the current implementation by default. But be able to deactivate it and when onHotword is triggered send a message on Hermes to play the feedback sound or simply return

Psychokiller1888 avatar Jun 26 '18 16:06 Psychokiller1888

Something like

self.mqttClient.message_callback_add('hermes/hotword/alice/detected', self.onHotwordDetected)
....
def onHotwordDetected(self, client, data, msg):
	if not self.awake:
		return
	else:
		publish.single('hermes/feedback/sound/play', payload=json.dumps({'siteId': device}), hostname='127.0.0.1', port=1883)

Psychokiller1888 avatar Jun 26 '18 16:06 Psychokiller1888

you should be able to already do that, using the hermes/audioServer/playBytes topic to send the wav to play and deactivating the feedback in the dialogue

fredszaq avatar Jun 27 '18 08:06 fredszaq

that's true, but sending a file that says "yes" will be captured by the ASR, starting a monolog, because the ASR is already turned on, which is not the case for the feedback sound

Psychokiller1888 avatar Jun 27 '18 10:06 Psychokiller1888

@fredszaq you told me you were on it? :) :) :)

Psychokiller1888 avatar Jan 27 '19 20:01 Psychokiller1888

After discussion, It seems that this feature is not likely to get implemented.

@Psychokiller1888 Do you have a use case description?

cpoisson avatar Mar 12 '19 14:03 cpoisson

https://laurentchervet.wordpress.com/2019/03/06/satellites-and-the-multidetection-hell/

https://puu.sh/CYSsX.png

Psychokiller1888 avatar Mar 12 '19 14:03 Psychokiller1888

This is only one exemple. We've discussed that a lot with Fred when I was in Paris

Psychokiller1888 avatar Mar 12 '19 14:03 Psychokiller1888

@cpoisson many have asked for this :) My blog post revived it

https://puu.sh/CZM1s.png https://puu.sh/CZM1s.png

Psychokiller1888 avatar Mar 14 '19 08:03 Psychokiller1888