PDFium Component Docs

EstimateSpokenWordIndex function

Unit: PDFium
מעריך את אינדקס המילה המדוברת הנוכחית עבור מנועי דיבור שאינם מדווחים על מיקומי מילים

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 כאשר הטווח ריק או שהתזמון המשוער הסתיים

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