Delay ASR start time after Hotword

Hi all. Really stumped on this. Is there any way to delay the ASR from starting after a personal wakeword?
I want the TTS to say my name (or another sentence) after my personal wakeword. Problem is when the TTS gets around to playing the wave (Hi Bill), the ASR has already started listening and ASR captures “JUNK JUNK garage lights off”.
I’ve tried asr/toggleOff and back on…but it appears my MQTT is not fast enough to stop the ASR . It WILL stop the ASR… but a few seconds too late. Also tried endSession / continueSession tricks but no go.
What’s the best way?.. FYI I only use MQTT to another machine where my “action code” is.

more info needed here… how are you coding the tts to say “hi bill” ?? are you just posting a tts/say on mqtt?? because that is not the right way

You can enable the feedback sound notification and change the wav file to one you make yourself keeping it to 16k 16bit wave and replacing the ding file with your new file

I subscribe to hermes/hotword/default/detected then send either tts/say and playBytes. Both wavs are heard fine…

I really cant change the sound notification wav file because it can change depending on what i want it to say. (and the MQTT publish is from a different host).

Any way to delay when the ASR starts?

no you can’t do it that way… tts/say is really a snips only mqtt topic to use, not end user… its not intended to work that way

you will have to use the endSession to end it and then send a startSession with “hi Bill” and work that way

Thx ozie for best practice.
So i tried the ending/starting. snips-watch showed I successfully ended the session and started a new session. “text” in But after starting, snips just hangs. I published this: (c code)
‘hermes/dialogueManager/startSession’ -m ‘{“siteId”:“default”,“init”:{“type”:“action”,“canbeEnqueued”:“true”}}’"
snips-watch shows the session was started. But ASR/NLU/nothing starts afterwards.
What am i missing? If i want to start a new session from a remote host, what MQTT messages should i send?

sorry typo’s… (“text” in) was unfinished sentence meaning MQTT startSession successfully says to tts “Hi Bill”.
Also docs are written “canBeEnqueued” but really it is “canbeEnqueued”.

i think it needs to be “canbeEnqueued”:true where the bool value is not in quotes

Hi Ozie
Correct. that is exactly what i have. mosquitto_pub -h HOSTIP -p 1883 -t ‘hermes/dialogueManager/startSession’ -m ‘{“siteId”:“default”,“init”:{“type”:“action”,“canbeEnqueued”:“true”,“text”:“Hi Bill”}}’
You mentioned the best way (instead of tts/say) was to close the original session and start a new session. Using a mosquitto client from another host, I successfully ended the current session. When I then call startSession, a session starts…then speaks Hi Bill…then instantly the session is ended. No ASR, NLU, parsing…
Are there more (other) mqtt messages I need to send? Are there any examples using a mosquitto client to duplicate a complete session?

its still in quotes :slight_smile: hahaha

you just need to write a little script… something that listens to the hotword topic and then reads the values of which device its from… it then ends the session and starts a new one

ill see if i have some code laying around

geez… LOL. Now i see what your saying. Thanks for being patient with me!!! :smile: Appreciate it. I live in “C” and assumed a string. It should be… ‘{“siteId”:“default”,“init”:{“type”:“action”,“canbeEnqueued”:true,“text”:“Hi Bill”}}’

I am listening (subscribing) successfully on another host for topics hotword / textCaptured / sessionStarted … reading/parsing the values returned. This is all working.

Strange…if I leave out “text”:“Hi Bill” at the end of startSession, all seems to be working. ASR works and NLU parses intent. But if i put in startSession “text”:“Hi Bill” (like above example), it plays the wav fine but then stops after AudioServer plays the wav file. ASR does not begin to listen. This is my current problem. Do you know the reason why it hangs and ASR does not start??

If you have example mosquitto client code that i can use from command line, would be great.
Hopefully this thread (your help) will assist others.
Thx Bill

I am not sure if it it just the way the pasting of the text in here is or not, but all your quotes are not quotes like "" they are ”“ (different could be because your not using a ` or blockquote to format your posts)

this code works just fine for me here (you will have to change the mqtt server ip and your snips device name for it to work for you)

mosquitto_pub -h snipsserver.local -p 1883 -t "hermes/dialogueManager/startSession" -m '{"siteId":"zero","init":{"type":"action","canbeEnqueued":true,"text":"Hi Bill"}}'

Hi ozie
Thanks for you help. I’m good now. I became much more familiar with start/endSession and mqtt. I’m not using tts/say.
I have exactly what i wanted… a personalized tts response after my spoken hotword that is controlled by another host via mqtt.

Hi @pianobill,

could you please describe how you built your solution? I have exactly the same situation.

I want to delay after hotword detection the feedback sound and ASR because I have to switch on the box. Unfortunately the box switches to standby after a few minutes.

Any help would be appreciated.

Thanks in advance!

Hi Freddy… I’m not sure what you mean by “Unfortunately the box switches to standby after a few minutes”…
I overcame this by changing the default “ding” wav files to silent wav files that are exactly the length in seconds i want to pause. I found no other way than this.
Now if we can get Snips to not break stuff when we upgrade, that would be great!. After my upgrade to 0.64.0, respeakers went silent… bummer.

Hi @pianobill,

I reached the goal with an external script which closes session and then reopens after a short break.

Thanks for your hints!