type TPdfReadingSession = class(TComponent) ... end;
The session never talks to a speech engine directly; the host handles OnSpeak, cancel, pause and resume callbacks while the session tracks chunks and words
Load chunks with LoadSpoken, start with Play or PlayFrom, then call Tick as the engine reports busy or idle state
When the speech engine reports a spoken character offset, call FeedSpokenPosition so the attached TPdfView can highlight the current word
Optional SelectionMode synchronises native word or chunk selections whilst preserving the disabled default and respecting manual selection overrides when playback stops
WordSegmentation defaults to wsmWhitespace, preserving the original space/tab/newline/NBSP tokenizer
Explicit wsmCjk provides deterministic tailored units: individual Han scalars, Hiragana runs, Katakana runs, Hangul runs, separate punctuation and script transitions, including fullwidth forms and Unicode whitespace
Recognised combining accents, voiced marks and variation selectors remain with the preceding unit; valid surrogate pairs are never split
This profile provides useful navigation units without a dictionary and is not linguistic Chinese/Japanese word recognition or full Unicode boundary-conformance; see Unicode text segmentation for the distinction between default boundaries and language-specific tailoring
Document, viewer and session modes are independent; change the applicable host before extracting or playing words
Viewer changes clear tracked/prefetched word geometry and the active cursor; session changes stop playback so the next chunk uses the selected mode
Native CJK word boxes include CharacterIndices, mapping each UTF-16 text unit to its native character index; StartIndex and Count remain native ranges, whilst pure BuildWordBoxes uses UTF-16 ranges
BuildSpokenTextFromWords preserves adjacent source units without inserting artificial spaces and emits exact source mappings from CharacterIndices; invalid explicit maps raise EPdfError
ReadingSession1.View := PdfView1;
ReadingSession1.LoadSpoken(Chunks);
ReadingSession1.Play;