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

Side by Side Diff: content/browser/speech/speech_recognition_manager_impl.cc

Issue 10629003: Adding support for the SpeechRecognition.maxAlternatives JS API parameter (Speech CL2.5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small nits Created 8 years, 6 months 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 "content/browser/speech/speech_recognition_manager_impl.h" 5 #include "content/browser/speech/speech_recognition_manager_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/browser_main_loop.h" 8 #include "content/browser/browser_main_loop.h"
9 #include "content/browser/speech/google_one_shot_remote_engine.h" 9 #include "content/browser/speech/google_one_shot_remote_engine.h"
10 #include "content/browser/speech/google_streaming_remote_engine.h" 10 #include "content/browser/speech/google_streaming_remote_engine.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 delegate_->GetDiagnosticInformation(&can_report_metrics, &hardware_info); 92 delegate_->GetDiagnosticInformation(&can_report_metrics, &hardware_info);
93 93
94 SpeechRecognitionEngineConfig remote_engine_config; 94 SpeechRecognitionEngineConfig remote_engine_config;
95 remote_engine_config.language = config.language; 95 remote_engine_config.language = config.language;
96 remote_engine_config.grammars = config.grammars; 96 remote_engine_config.grammars = config.grammars;
97 remote_engine_config.audio_sample_rate = 97 remote_engine_config.audio_sample_rate =
98 SpeechRecognizerImpl::kAudioSampleRate; 98 SpeechRecognizerImpl::kAudioSampleRate;
99 remote_engine_config.audio_num_bits_per_sample = 99 remote_engine_config.audio_num_bits_per_sample =
100 SpeechRecognizerImpl::kNumBitsPerAudioSample; 100 SpeechRecognizerImpl::kNumBitsPerAudioSample;
101 remote_engine_config.filter_profanities = config.filter_profanities; 101 remote_engine_config.filter_profanities = config.filter_profanities;
102 remote_engine_config.max_hypotheses = config.max_hypotheses;
102 remote_engine_config.hardware_info = hardware_info; 103 remote_engine_config.hardware_info = hardware_info;
103 remote_engine_config.origin_url = can_report_metrics ? config.origin_url : ""; 104 remote_engine_config.origin_url = can_report_metrics ? config.origin_url : "";
104 105
105 SpeechRecognitionEngine* google_remote_engine; 106 SpeechRecognitionEngine* google_remote_engine;
106 if (config.is_one_shot) { 107 if (config.is_one_shot) {
107 google_remote_engine = 108 google_remote_engine =
108 new GoogleOneShotRemoteEngine(config.url_request_context_getter); 109 new GoogleOneShotRemoteEngine(config.url_request_context_getter);
109 } else { 110 } else {
110 google_remote_engine = 111 google_remote_engine =
111 new GoogleStreamingRemoteEngine(config.url_request_context_getter); 112 new GoogleStreamingRemoteEngine(config.url_request_context_getter);
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 531
531 SpeechRecognitionManagerImpl::Session::Session() 532 SpeechRecognitionManagerImpl::Session::Session()
532 : id(kSessionIDInvalid), 533 : id(kSessionIDInvalid),
533 listener_is_active(true) { 534 listener_is_active(true) {
534 } 535 }
535 536
536 SpeechRecognitionManagerImpl::Session::~Session() { 537 SpeechRecognitionManagerImpl::Session::~Session() {
537 } 538 }
538 539
539 } // namespace speech 540 } // namespace speech
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698