I am trying to call a callback function after chrome.tts.speak has finished the speech, and there is a nice argument space for that. But, after looking for more detail about it, very disappointingly, this is what the document says:
callback ( optional function )
Called right away, before speech finishes.
And I don’t want it to be called right away. I want it after the speech is finished. So is it possible? Any method is welcomed. (but not so “hacky”)
In the same page, it mentions
onEvent(as part ofoptions):TtsEventhas atypeproperty, which can beendto mark the speech ending. Put it together: