diff options
author | primiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 17:48:54 +0000 |
---|---|---|
committer | primiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-27 17:48:54 +0000 |
commit | 2b0f67f2c247009fb924c3e3c061f81a233cdf9f (patch) | |
tree | 86737cb36b471ab969334f59863a34d93351aebd /content/browser/speech/google_streaming_remote_engine.cc | |
parent | 2115e1e021f8b7146e1fe00b11e05a89d7372128 (diff) | |
download | chromium_src-2b0f67f2c247009fb924c3e3c061f81a233cdf9f.zip chromium_src-2b0f67f2c247009fb924c3e3c061f81a233cdf9f.tar.gz chromium_src-2b0f67f2c247009fb924c3e3c061f81a233cdf9f.tar.bz2 |
Adding support for the SpeechRecognition.maxAlternatives JS API parameter (Speech CL2.5)
BUG=116954
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10629003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/google_streaming_remote_engine.cc')
-rw-r--r-- | content/browser/speech/google_streaming_remote_engine.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc index e38a01f..01f37a3 100644 --- a/content/browser/speech/google_streaming_remote_engine.cc +++ b/content/browser/speech/google_streaming_remote_engine.cc @@ -35,9 +35,6 @@ using net::URLFetcher; namespace { -// TODO(primiano): This shouldn't be a const, rather it should be taken from -// maxNBest property (which is not yet implemented in WebKit). -const int kMaxResults = 5; const char kDownstreamUrl[] = "/down?"; const char kUpstreamUrl[] = "/up?"; const int kAudioPacketIntervalMs = 100; @@ -322,8 +319,6 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) { std::vector<std::string> downstream_args; downstream_args.push_back("sky=" + GetWebserviceKey()); downstream_args.push_back("pair=" + request_key); - downstream_args.push_back("maxresults=" + base::IntToString(kMaxResults)); - GURL downstream_url(GetWebserviceBaseURL() + std::string(kDownstreamUrl) + JoinString(downstream_args, '&')); // TODO(primiano): /////////// Remove this after debug stage. ///////////// @@ -347,9 +342,12 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) { "lang=" + net::EscapeQueryParamValue(GetAcceptedLanguages(), true)); upstream_args.push_back( config_.filter_profanities ? "pfilter=2" : "pfilter=0"); - upstream_args.push_back("maxresults=" + base::IntToString(kMaxResults)); + if (config_.max_hypotheses > 0U) { + upstream_args.push_back("maxresults=" + + base::UintToString(config_.max_hypotheses)); + } + // TODO(primiano) What is this client= parameter? Check with speech team. upstream_args.push_back("client=myapp.mycompany.com"); - // TODO(primiano): Can we remove this feature sending audio HW information? if (!config_.hardware_info.empty()) { upstream_args.push_back( "xhw=" + net::EscapeQueryParamValue(config_.hardware_info, true)); |