OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" | 5 #include "chrome/browser/chromeos/accessibility/speech_monitor.h" |
6 | 6 |
7 namespace chromeos { | 7 namespace chromeos { |
8 | 8 |
9 namespace { | 9 namespace { |
10 const char kChromeVoxEnabledMessage[] = "chrome vox spoken feedback is ready"; | 10 const char kChromeVoxEnabledMessage[] = "chrome vox spoken feedback is ready"; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 voice.name = "SpeechMonitor"; | 77 voice.name = "SpeechMonitor"; |
78 voice.events.insert(TTS_EVENT_END); | 78 voice.events.insert(TTS_EVENT_END); |
79 } | 79 } |
80 | 80 |
81 std::string SpeechMonitor::error() { | 81 std::string SpeechMonitor::error() { |
82 return ""; | 82 return ""; |
83 } | 83 } |
84 | 84 |
85 void SpeechMonitor::WillSpeakUtteranceWithVoice(const Utterance* utterance, | 85 void SpeechMonitor::WillSpeakUtteranceWithVoice(const Utterance* utterance, |
86 const VoiceData& voice_data) { | 86 const VoiceData& voice_data) { |
| 87 // Filter out empty utterances which can be used to trigger a start event from |
| 88 // tts as an earcon sync. |
| 89 if (utterance->text() == "") |
| 90 return; |
| 91 |
87 VLOG(0) << "Speaking " << utterance->text(); | 92 VLOG(0) << "Speaking " << utterance->text(); |
88 utterance_queue_.push_back(utterance->text()); | 93 utterance_queue_.push_back(utterance->text()); |
89 if (loop_runner_.get()) | 94 if (loop_runner_.get()) |
90 loop_runner_->Quit(); | 95 loop_runner_->Quit(); |
91 } | 96 } |
92 | 97 |
93 } // namespace chromeos | 98 } // namespace chromeos |
OLD | NEW |