Repository navigation
Version 0.10.0
What's Changed
Added
ExtractUtterancesOptions.segmentation— split utterances at real sentence boundaries instead of one per structural unit, reconstructing a sentence across sibling nodes when it genuinely spans them.mode: "sentence"(default"structure"), plussuppressions(per-language abbreviations to not treat as sentence endings) andsegmenter(swap in a custom sentence segmenter for the built-inIntl.Segmenter-based one).ReadiumSpeechUtterance.offsets/UtteranceOffset— the ranges ofplain/ssmlbacked by real source text, each with its ownlocate; an utterance with none is whatsyntheticused to flag.ReadiumSpeechNavigator's"boundary"event, previously only"word", now also fires"sentence"/"structure"(matching the activesegmentationmode) whenever the current utterance changes, withdetail.locateresolved to aLocatorOptions[].resolveUtteranceLocate()(sentence/structure) andresolveBoundaryLocate()(word) are the two helpers behind this — the same ones to call yourself when driving playback withoutReadiumSpeechNavigator.ReadiumSpeechNavigatorConfiguration.segmentationOverridesandISpeechPreferences.segmentation/ISpeechDefaults.segmentation— the livesegmentation.modepreference, plus construction-timesuppressions/segmenter.ExtractUtterancesOptions.substitutions— rewrite ASCII imitations of Unicode symbols (e.g."1/2","(c)") so the engine speaks the symbol, merged on top of a built-in table.makeGnd()/parseMarkup()'stextrefs.rolesaccepts"leaf-text", matching a roleless block that owns its own text directly (e.g. a<div>standing in for<p>).
Fixed
WebSpeechEngineno longer resolves a stray/delayedboundaryevent from an already-cancelled utterance against whatever utterance is current by the time it arrives.WebSpeechEngineno longer emits a duplicatestart/pause/resumeevent for the same playback action — previously fired once eagerly and again from the nativeSpeechSynthesisUtteranceevent, which also doubledReadiumSpeechNavigator's synthesizedboundaryevent onstart.- Text sent to
WebSpeechEngine/SpeechServerEnginenow has angle brackets neutralized so plain text containing</>can't be misread as markup. - Generated CSS selectors (
makeGnd()/parseMarkup()) no longer use attribute selectors, which could latch onto a JS-mutated attribute (e.g. an inlinestyleset by a layout script) and silently stop matching once it changed.
Removed
ReadiumSpeechUtterance.synthetic— an empty/absentoffsetsis now what marks an utterance as synthesized rather than sourced.
Full Changelog: v0.9.2...v0.10.0