Home | History | Annotate | Download | only in extensions

Lines Matching defs:utterance

20 const char kSpeechInterruptedError[] = "Utterance interrupted.";
21 const char kSpeechRemovedFromQueueError[] = "Utterance removed from queue.";
47 // Utterance
51 int Utterance::next_utterance_id_ = 0;
53 Utterance::Utterance(Profile* profile,
101 Utterance::~Utterance() {
105 void Utterance::FinishAndDestroy() {
131 void ExtensionTtsController::SpeakOrEnqueue(Utterance* utterance) {
132 if (IsSpeaking() && utterance->can_enqueue()) {
133 utterance_queue_.push(utterance);
136 SpeakNow(utterance);
141 Utterance* utterance) {
142 ExtensionService* service = utterance->profile()->GetExtensionService();
145 utterance->profile()->GetExtensionEventRouter();
165 !utterance->voice_name().empty() &&
166 voice.voice_name != utterance->voice_name()) {
170 !utterance->locale().empty() &&
171 voice.locale != utterance->locale()) {
175 !utterance->gender().empty() &&
176 voice.gender != utterance->gender()) {
187 void ExtensionTtsController::SpeakNow(Utterance* utterance) {
188 std::string extension_id = GetMatchingExtensionId(utterance);
190 current_utterance_ = utterance;
191 utterance->set_extension_id(extension_id);
194 args.Set(0, Value::CreateStringValue(utterance->text()));
199 utterance->options()->DeepCopy());
204 args.Set(2, Value::CreateIntegerValue(utterance->id()));
208 utterance->profile()->GetExtensionEventRouter()->DispatchEventToExtension(
212 utterance->profile(),
220 utterance->text(),
221 utterance->locale(),
222 utterance->gender(),
223 utterance->rate(),
224 utterance->pitch(),
225 utterance->volume());
227 utterance->set_error(GetPlatformImpl()->error());
228 utterance->FinishAndDestroy();
231 current_utterance_ = utterance;
233 // Check to see if it's still speaking; finish the utterance if not and
262 // already finished the utterance (for example because another utterance
286 // Start speaking the next utterance in the queue. Keep trying in case
289 Utterance* utterance = utterance_queue_.front();
291 SpeakNow(utterance);
297 Utterance* utterance = utterance_queue_.front();
299 utterance->set_error(kSpeechRemovedFromQueueError);
300 utterance->FinishAndDestroy();
316 // If we're still speaking something (either the prevoius utterance or
317 // a new utterance), keep calling this method after another delay.
351 utterance_ = new Utterance(profile(), text, options, completion_task);