Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chrome/browser/speech/extension_api/tts_engine_extension_api.cc

Issue 27034009: Implement Google network speech synthesis (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert change to register_engine for now, rebase for relanding Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/speech/extension_api/tts_engine_extension_api.h" 5 #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 for (size_t i = 0; i < tts_voices->size(); ++i) { 85 for (size_t i = 0; i < tts_voices->size(); ++i) {
86 const extensions::TtsVoice& voice = tts_voices->at(i); 86 const extensions::TtsVoice& voice = tts_voices->at(i);
87 87
88 out_voices->push_back(VoiceData()); 88 out_voices->push_back(VoiceData());
89 VoiceData& result_voice = out_voices->back(); 89 VoiceData& result_voice = out_voices->back();
90 90
91 result_voice.native = false; 91 result_voice.native = false;
92 result_voice.name = voice.voice_name; 92 result_voice.name = voice.voice_name;
93 result_voice.lang = voice.lang; 93 result_voice.lang = voice.lang;
94 result_voice.remote = voice.remote;
94 result_voice.extension_id = extension->id(); 95 result_voice.extension_id = extension->id();
95 if (voice.gender == constants::kGenderMale) 96 if (voice.gender == constants::kGenderMale)
96 result_voice.gender = TTS_GENDER_MALE; 97 result_voice.gender = TTS_GENDER_MALE;
97 else if (voice.gender == constants::kGenderFemale) 98 else if (voice.gender == constants::kGenderFemale)
98 result_voice.gender = TTS_GENDER_FEMALE; 99 result_voice.gender = TTS_GENDER_FEMALE;
99 else 100 else
100 result_voice.gender = TTS_GENDER_NONE; 101 result_voice.gender = TTS_GENDER_NONE;
101 102
102 for (std::set<std::string>::const_iterator iter = 103 for (std::set<std::string>::const_iterator iter =
103 voice.event_types.begin(); 104 voice.event_types.begin();
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 utterance_id, TTS_EVENT_PAUSE, char_index, std::string()); 252 utterance_id, TTS_EVENT_PAUSE, char_index, std::string());
252 } else if (event_type == constants::kEventTypeResume) { 253 } else if (event_type == constants::kEventTypeResume) {
253 controller->OnTtsEvent( 254 controller->OnTtsEvent(
254 utterance_id, TTS_EVENT_RESUME, char_index, std::string()); 255 utterance_id, TTS_EVENT_RESUME, char_index, std::string());
255 } else { 256 } else {
256 EXTENSION_FUNCTION_VALIDATE(false); 257 EXTENSION_FUNCTION_VALIDATE(false);
257 } 258 }
258 259
259 return true; 260 return true;
260 } 261 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698