Please forgive my density but I cannot solve this simple issue. When my call settings button is clicked, the variable, GlobalAtmoCount = 0. In my simple mind, the +1 portion should restrict the text to being spoken only once and not repeatedly while the contition is true. I change the globalAtmoCount back to zero when the screen 1 backpress button is clicked. Due to uncertainty, I tried three ways and all three configurations speak the text repeatedly.
So, if I were to phrase this as a question and not a presentation, how the heck can I prevent the TextToSpeech1 from repeating without clicking the Call_Settings button again? I would really appreciate any assistance. I am just to close to this and it is too simple for my overthinking mind.
Here I am answering myself. I could delete this post but it may help. I was placing the counter block in a section that only occurred once. It was the After.Speech block that required the counters, as shown here:
On rereading your post, I realize I have not addressed your problem.
You are asking how to suppress repetition of error announcements.
To do so, you would need to keep two data structures:
a policy dictionary, with announcement text values as keys, and minimum announcement delay intervals as values. Milliseconds are easiest.
an announcement history scoreboard dictionary, with those same announcement text values as keys, and for values the Clock1.SystemTime of when that announcement was last issued (or 0 if not yet).
The policy dictionary balances the need to announce against the need for a period of peace and quiet in between announcements.
The basic idea would be to have the announcing procedure look up the message in the announcement history dictionary, and test current (Clock1.SystemTime - last issued SystemTime from the announcement history dictionary) to see if it exceeds the matching policy delay milliseconds value.
If the cool down period is over, make the announcement and update the history dictionary, otherwise ignore the request entirely.