PDFium Component Docs

EstimateSpokenWordIndex function

Unit: PDFium
Ước lượng chỉ mục từ đang được đọc cho các engine nói không báo vị trí từ

Syntax

function EstimateSpokenWordIndex(const Words: TPdfWordBoxes; ElapsedMs: Cardinal; WordsPerMinute: Integer): Integer;

Parameters

WordsTPdfWordBoxes - Words in the chunk currently being spoken
ElapsedMsCardinal - Milliseconds elapsed since the current chunk started speaking
WordsPerMinuteInteger - Estimated speech rate, or 0 to use the default 175 WPM

Return Value

Zero-based word index, or -1 khi phạm vi rỗng hoặc lịch ước lượng đã kết thúc

Description

The helper budgets the whole range as one word per 60000 / WordsPerMinute milliseconds

Each word receives a share of that budget proportional to its text length plus a small inter-word pause weight

Remarks

Example

WordIndex := EstimateSpokenWordIndex(Words, ElapsedMs, 175);
if WordIndex >= 0 then
  PdfView1.SetReadingWord(Words[WordIndex]);

See Also

TPdfWordBox, TPdfReadingSession.EstimatePacing, TPdfReadingSession.Tick