The workaround (or mechanism) I have is to split the given message into a list of paragraphs by the new line character \n
, (or into a list of sentences by the full stop character .
if more appropriate in your case) and repeatedly call a procedure in which TextToSpeech is called to speak just a single paragraph.
(我必须采取的解决方法(或机制)是将给定消息用换行符\n
拆分为段落列表(或如果使用句点字符.
则用句号分隔句段),然后重复调用一个过程,其中调用TextToSpeech仅说单个段落。)
And in the event of TextToSpeech AfterSpeaking, check if there is more paragraph to speak; (如果出现TextToSpeech AfterSpeaking,请检查是否还有更多要说的段落;)
if so, call the same procedure again. (如果是这样,请再次调用相同的过程。)
This way, every time TextToSpeech.Speak
is called, the given message is small enough for it to work properly.
(这样,每次调用TextToSpeech.Speak
,给定的消息就足够小以使其正常工作。)
Now there is no problem to speak a long message such as the text of Genesis chapter one. (现在说长消息,如创世记第一章的文本,没有问题。)
See below the blocks:
(请参见下面的块:)
Note on the App Inventor version I'm working with:
(关于我正在使用的App Inventor版本的注意事项 :)
Built: November 26 2019 Version: nb180a
Use Companion: 2.55 or 2.55u or 2.55 or 2.55uu
Target Android SDK: 28 (Android 9.0 Pie)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…