function EstimateSpokenWordIndex(const Words: TPdfWordBoxes; ElapsedMs: Cardinal; WordsPerMinute: Integer): Integer;
| Words | TPdfWordBoxes - 目前朗讀區塊中的詞 |
| ElapsedMs | Cardinal - 目前區塊開始朗讀後經過的毫秒數 |
| WordsPerMinute | Integer - 估計的語速,設為 0 則使用預設的 175 WPM |
-1此輔助函式會以每個詞 60000 / WordsPerMinute 毫秒的方式為整個範圍分配時間預算
每個詞會依文字長度按比例分得預算,再加上少量的詞間停頓權重
TPdfReadingSession.Tick 會在 EstimatePacing 啟用時使用此輔助函式WordIndex := EstimateSpokenWordIndex(Words, ElapsedMs, 175);
if WordIndex >= 0 then
PdfView1.SetReadingWord(Words[WordIndex]);