Ok, I’ve thought this through a bit more and I have an issue which I don’t think can be covered.
How can we deal with ‘announcement clash’?
If an announcement is made and before it is finished another one is requested the first will, I believe be cut short when the second one starts.
This was always a problem in the past but was worked around by checking for playing
, paused
or idle
or by using media_duration
in a wait
.
I used this technique to make long messages sound a lot more natural by imposing a pause between sections.
Specifically, for example I have a morning greeting that has many parts…
Weather
News headlines
Bins and other reminders
Whether Arsenal have a match today ( )
etc. etc.
There is no way that I know of (please correct me if I am wrong!) to create a pause in a TTS announcement, so as my script combines all the sections of the announcement it inserts a token where I want a pause. The script splits the message at the tokens and plays each one in a separate tts call with a delay
between them equal to the number of ‘pause tokens’ inserted at that point.
e.g.
“This is the weather.[PAUSE]This is the news.[PAUSE][PAUSE]This is the bin reminder.”
Would give a one second pause between the weather and the news, and a two second pause between the weather and the bin reminder.
The script has a wait
between announcements for the previous one to finish.
I know this may sound over engineered but when you hear the announcement every day it makes a difference when it sounds more natural. Without the pauses it is just a constant stream of talking.
I don’t believe this is possible any longer.
PS. Yes I could do away with my overengineered pauses and have separate announcements but that doesn’t solve the problem that there is no way of knowing when it is ‘safe’ to start the next one.
Unless of course I have missed something fundamental?