function EstimateSpokenWordIndex(const Words: TPdfWordBoxes; ElapsedMs: Cardinal; WordsPerMinute: Integer): Integer;
| Words | TPdfWordBoxes - 当前正在朗读的块中的单词 |
| ElapsedMs | Cardinal - 自当前块开始朗读以来经过的毫秒数 |
| WordsPerMinute | Integer - 估计的语速,或 0 表示使用默认的 175 WPM |
-1该辅助函数将整个范围按每个单词 60000 / WordsPerMinute 毫秒进行预算
每个单词按与其文本长度成比例分配该预算的一部分,再加上一个小的词间停顿权重
EstimatePacing 时,TPdfReadingSession.Tick 使用此辅助函数WordIndex := EstimateSpokenWordIndex(Words, ElapsedMs, 175);
if WordIndex >= 0 then
PdfView1.SetReadingWord(Words[WordIndex]);