PDFium Component Docs

EstimateSpokenWordIndex 함수

유닛: PDFium
음성 엔진이 단어 위치를 보고하지 않을 때 현재 spoken 단어 인덱스를 추정합니다

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