Runtime error stack size 8188KB (use of TextToSpeech.Stop)

I had this problem in an app: 'Runtime error stack size 8188KB'. I reproduced the skeleton of the app in these blocks that I show you in the image. It gives me the same error. If I delete the indicated block it's fine.

Do you need to "stop" the speaking in the afterSpeaking event (which is when there is not speaking to "stop" ?)

NO I don't. Is only to understand why. I spent 2 days trying to find out why my app went in that error. So I would like to know what is wrong with that STOP.

SpeechRecognizer.Stop is a new App Inventor 2 'feature'; there could be a bug.

You can try replacing Stop with TextToSpeech1.Speak message where the puzzle piece is an empty Text block. That was the way to shut down the TTS speaking prior to Stop.

I expect Stop doesn't work in the AfterSpeaking block as the message buffer has already emptied as Tim mentions. So just don't place it there . :cry: It is inappropriate use of Stop probably which might be a bug. Why do you think it is necessary to place Stop there?

OK thanks.

I was getting errors of other nature and I tryed to put a stop but whent worst.

1 Like

(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
export_and_upload_aia

test_sr.aia (4.9 KB)
As I said the STOP to textspeech cause the stack size error. The line is not usefull but is interesting to know why produce the error.

Calling the Stop method causes the underlying TTS framework to trigger its onStop event, which App Inventor converts into the AfterSpeaking event, which calls the Stop, which causes the underlying TTS framework to trigger its onStop event, which App Inventor converts into the AfterSpeaking event, which calls the Stop, which causes the underlying TTS framework to trigger its onStop event, which App Inventor converts into the AfterSpeaking event, which calls the Stop, etc.

Repeat until the call stack has been exhausted.

1 Like

OK I agree (if of any importance). TY