Index: chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
index 6db90bedc4683c36d480facef4f72789e479b3bc..7eebc0b2c0351d52dc0fd00e3cf5139afb015311 100644 |
--- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
+++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
@@ -138,6 +138,13 @@ void TtsExtensionEngine::GetVoices(content::BrowserContext* browser_context, |
void TtsExtensionEngine::Speak(Utterance* utterance, |
const VoiceData& voice) { |
+ LOG(ERROR) << "TtsExtensionEngine::Speak"; |
David Tseng
2015/03/16 17:56:50
Remove
|
+ { |
+ std::string json; |
+ base::JSONWriter::Write(utterance->options(), &json); |
+ LOG(ERROR) << "Options: " << json; |
David Tseng
2015/03/16 17:56:50
Remove
|
+ } |
+ |
// See if the engine supports the "end" event; if so, we can keep the |
// utterance around and track it. If not, we're finished with this |
// utterance now. |
@@ -163,6 +170,22 @@ void TtsExtensionEngine::Speak(Utterance* utterance, |
if (options->HasKey(constants::kOnEventKey)) |
options->Remove(constants::kOnEventKey, NULL); |
+ // Get the volume, pitch, and rate, but only if they weren't already in |
+ // the options. TODO(dmazzoni): these shouldn't be redundant. |
+ // http://crbug.com/463264 |
+ if (!options->HasKey(constants::kRateKey)) { |
+ options->SetDouble(constants::kRateKey, |
+ utterance->continuous_parameters().rate); |
+ } |
+ if (!options->HasKey(constants::kPitchKey)) { |
+ options->SetDouble(constants::kPitchKey, |
+ utterance->continuous_parameters().pitch); |
+ } |
+ if (!options->HasKey(constants::kVolumeKey)) { |
+ options->SetDouble(constants::kVolumeKey, |
+ utterance->continuous_parameters().volume); |
+ } |
+ |
// Add the voice name and language to the options if they're not |
// already there, since they might have been picked by the TTS controller |
// rather than directly by the client that requested the speech. |
@@ -174,6 +197,10 @@ void TtsExtensionEngine::Speak(Utterance* utterance, |
args->Append(options.release()); |
args->AppendInteger(utterance->id()); |
+ std::string json; |
+ base::JSONWriter::Write(args.get(), &json); |
+ LOG(ERROR) << "To Extension: " << json; |
David Tseng
2015/03/16 17:56:50
Remove
|
+ |
scoped_ptr<extensions::Event> event(new extensions::Event( |
tts_engine_events::kOnSpeak, args.Pass())); |
Profile* profile = Profile::FromBrowserContext(utterance->browser_context()); |