Set Default TTS voice as Female/en_US 55/184855/1
authorsurya.kumar7 <surya.kumar7@samsung.com>
Mon, 23 Jul 2018 15:14:18 +0000 (20:44 +0530)
committersurya.kumar7 <surya.kumar7@samsung.com>
Mon, 23 Jul 2018 15:14:57 +0000 (20:44 +0530)
To resemeble crosswalk, set default TTS voice as Female/en_US
in TtsDispatcher's construction

Change-Id: I4a5e8d1a1813fbd52f8780ac5b353ead777c069d
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
chromium_src/chrome/common/tts_utterance_request.cc
chromium_src/chrome/common/tts_utterance_request.h
chromium_src/chrome/renderer/tts_dispatcher.cc

index a2e3e7f..bb16da9 100644 (file)
@@ -19,6 +19,15 @@ TtsVoice::TtsVoice()
       is_default(false) {
 }
 
+TtsVoice::TtsVoice(std::string voice_uri, std::string name, std::string lang,
+                   bool local_service, bool is_default)
+    : voice_uri(voice_uri),
+      name(name),
+      lang(lang),
+      local_service(local_service),
+      is_default(is_default) {
+}
+
 TtsVoice::~TtsVoice() {
 }
 
index a4b4cab..1c5e829 100644 (file)
@@ -25,6 +25,8 @@ struct TtsUtteranceRequest {
 
 struct TtsVoice {
   TtsVoice();
+  TtsVoice(std::string voice_uri, std::string name, std::string lang,
+           bool local_service, bool is_default);
   ~TtsVoice();
 
   std::string voice_uri;
index 0d3b97c..e574de0 100644 (file)
@@ -21,11 +21,23 @@ using blink::WebSpeechSynthesisVoice;
 using blink::WebString;
 using blink::WebVector;
 
+namespace {
+
+static const std::vector<TtsVoice>& getDefaultVoiceList() {
+  static std::vector<TtsVoice> default_voices(
+    1, TtsVoice("localhost:Female/en_US", "Female", "en_US", false, false));
+
+  return default_voices;
+}
+
+} // namespace
+
 int TtsDispatcher::next_utterance_id_ = 1;
 
 TtsDispatcher::TtsDispatcher(WebSpeechSynthesizerClient* client)
     : synthesizer_client_(client) {
   RenderThread::Get()->AddObserver(this);
+  OnSetVoiceList(getDefaultVoiceList());
 }
 
 TtsDispatcher::~TtsDispatcher() {