PDFium Component Docs

EstimateSpokenWordIndex funkcija

Unit: PDFium
Procjenjuje trenutačni indeks izgovorene riječi za govorne mehanizme koji ne prijavljuju položaje riječi

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 when the range is empty or the estimated schedule has finished

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