Commit 98308108 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Fix character position update on TTS word callback

This CL is fixing a bug introduced in previous refactoring. The word
callback is supposed to send to the TTS controller the character
position but it was not updated.

see: https://bugs.chromium.org/p/chromium/issues/detail?id=1146237#c3

The regression was introduced here:
  https://chromium-review.googlesource.com/c/chromium/src/+/2462341

R=dmazzoni@chromium.org,fdoray@chromium.org

Bug: 1146237
Change-Id: Idc30e25ed1565721797362a71b4b19f0432187fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523104Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825369}
parent a4b090ee
......@@ -366,11 +366,15 @@ void TtsPlatformImplBackgroundWorker::OnSpeechEvent(int utterance_id) {
SendTtsEvent(utterance_id_, TTS_EVENT_MARKER, utterance_char_position_);
break;
case SPEI_WORD_BOUNDARY:
utterance_char_position_ =
static_cast<size_t>(event.lParam) - utterance_prefix_length_;
SendTtsEvent(utterance_id_, TTS_EVENT_WORD, utterance_char_position_,
static_cast<ULONG>(event.wParam));
break;
case SPEI_SENTENCE_BOUNDARY:
utterance_char_position_ =
static_cast<size_t>(event.lParam) - utterance_prefix_length_;
SendTtsEvent(utterance_id_, TTS_EVENT_SENTENCE,
utterance_char_position_);
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment