Support word events in Android tts voices
Tested with:
1. Android Google tts. Word events (aka onRangeStart), is supported by
the engine.
2. ETI Eloquence (3p engine); this engine does not support word
events. Verify the Chrome side voice never gets the word event(s) and
its voice data never gets "word".
Example js interaction with Android Google tts voice:
before = new Date(); chrome.tts.speak('hi, this is a test', {onEvent: e=>console.log((new Date() - before) + JSON.stringify(e))})
"54{"type":"start","charIndex":0}"
"100{"type":"word","charIndex":0,"length":2}"
"474{"type":"word","charIndex":4,"length":4}"
"599{"type":"word","charIndex":9,"length":2}"
"649{"type":"word","charIndex":12,"length":1}"
"671{"type":"word","charIndex":14,"length":4}"
"1315{"type":"end","charIndex":18}"
(this matches the same test when done on the same CHrome OS Google tts voice).
R=hirokisato@chromium.org
Test: manual
Bug: n/a
Change-Id: I3e859c850a53cdcc9840e979191df3d46ffc7979
AX-Relnotes: in Chrome OS, when using a text-to-speech voice from Android, supports word-related events. This makes it possible to get word highlighting in Select to Speak when using one of these voices, if it supports word events.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2713562
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: Hiroki Sato <hirokisato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#857029}
GitOrigin-RevId: 8def3a16a74d970eaffaa2be717c6b1099d1ce7b
1 file changed