PDFium Delphi Component Docs

EstimateSpokenWordIndex 함수

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

구문

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

매개변수

WordsTPdfWordBoxes - 현재 읽고 있는 청크의 단어들
ElapsedMsCardinal - 현재 청크 읽기를 시작한 뒤 경과한 밀리초
WordsPerMinuteInteger - 예상 발화 속도. 0을 넘기면 기본값 175 WPM을 사용합니다

반환 값

0 기반 단어 인덱스이며, 범위가 비었거나 예상 일정이 끝났으면 -1입니다

설명

헬퍼는 전체 범위를 단어당 60000 / WordsPerMinute 밀리초로 배분합니다

각 단어는 텍스트 길이에 비례한 몫에 단어 사이 짧은 쉬움 가중치를 더해 시간을 배정받습니다

참고 사항

예제

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

관련 항목

TPdfWordBox, TPdfReadingSession.EstimatePacing, TPdfReadingSession.Tick