| Index: content/browser/speech/google_one_shot_remote_engine.cc
|
| diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc
|
| index 452a34a9004ec13439814185552709119cf79706..a2f58b1f4719a1d7c50a032b060f883daeaa0d5a 100644
|
| --- a/content/browser/speech/google_one_shot_remote_engine.cc
|
| +++ b/content/browser/speech/google_one_shot_remote_engine.cc
|
| @@ -35,8 +35,6 @@ const char* const kConfidenceString = "confidence";
|
| const int kWebServiceStatusNoError = 0;
|
| const int kWebServiceStatusNoSpeech = 4;
|
| const int kWebServiceStatusNoMatch = 5;
|
| -const int kDefaultConfigSampleRate = 8000;
|
| -const int kDefaultConfigBitsPerSample = 16;
|
| const speech::AudioEncoder::Codec kDefaultAudioCodec =
|
| speech::AudioEncoder::CODEC_FLAC;
|
| // TODO(satish): Remove this hardcoded value once the page is allowed to
|
| @@ -156,14 +154,6 @@ namespace speech {
|
| const int GoogleOneShotRemoteEngine::kAudioPacketIntervalMs = 100;
|
| int GoogleOneShotRemoteEngine::url_fetcher_id_for_tests = 0;
|
|
|
| -GoogleOneShotRemoteEngineConfig::GoogleOneShotRemoteEngineConfig()
|
| - : filter_profanities(false),
|
| - audio_sample_rate(kDefaultConfigSampleRate),
|
| - audio_num_bits_per_sample(kDefaultConfigBitsPerSample) {
|
| -}
|
| -
|
| -GoogleOneShotRemoteEngineConfig::~GoogleOneShotRemoteEngineConfig() {}
|
| -
|
| GoogleOneShotRemoteEngine::GoogleOneShotRemoteEngine(
|
| net::URLRequestContextGetter* context)
|
| : url_context_(context) {
|
| @@ -172,7 +162,7 @@ GoogleOneShotRemoteEngine::GoogleOneShotRemoteEngine(
|
| GoogleOneShotRemoteEngine::~GoogleOneShotRemoteEngine() {}
|
|
|
| void GoogleOneShotRemoteEngine::SetConfig(
|
| - const GoogleOneShotRemoteEngineConfig& config) {
|
| + const SpeechRecognitionEngineConfig& config) {
|
| config_ = config;
|
| }
|
|
|
| @@ -199,8 +189,11 @@ void GoogleOneShotRemoteEngine::StartRecognition() {
|
| std::vector<std::string> parts;
|
| parts.push_back("lang=" + net::EscapeQueryParamValue(lang_param, true));
|
|
|
| - if (!config_.grammar.empty())
|
| - parts.push_back("lm=" + net::EscapeQueryParamValue(config_.grammar, true));
|
| + if (!config_.grammars.empty()) {
|
| + DCHECK_EQ(config_.grammars.size(), 1U);
|
| + parts.push_back("lm=" + net::EscapeQueryParamValue(config_.grammars[0].url,
|
| + true));
|
| + }
|
|
|
| if (!config_.hardware_info.empty())
|
| parts.push_back("xhw=" + net::EscapeQueryParamValue(config_.hardware_info,
|
|
|