Using Cast-Web_api and google home—how to tell if a Wait is needed?

I’m surprised I didn’t see a post about this but perhaps I missed something :wink:

Is there a way to know if the Google Home (or Cast-Web-Api) is busy? When I send a TTS command to the Google Home it happily speaks the text but if another request to speak happens right after it (without putting a wait…) the message is either skipped or steps on the previous one.

I have put “Wait…” for some time period and I can get it to work but I want a more general solution. Is there a way to know if it is still speaking and to be able to wait until it finishes? Seems not.

Also, I have played around with the Speak text and restore and Speak text and resume … but they don’t seem to work as I would expect… any ideas or ways others are doing this?

I was thinking of doing a computation of the string length times constant time value but that would be a true hack… and would likely either wait too long or not long enough at times.