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

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

Issue 21183002: Adding key press detection in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add linux impl Created 7 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_recognizer_impl.h" 5 #include "content/browser/speech/speech_recognizer_impl.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/browser_main_loop.h" 10 #include "content/browser/browser_main_loop.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 frames_per_buffer); 559 frames_per_buffer);
560 } 560 }
561 561
562 // Create an audio converter which converts data between native input format 562 // Create an audio converter which converts data between native input format
563 // and WebSpeech specific output format. 563 // and WebSpeech specific output format.
564 audio_converter_.reset( 564 audio_converter_.reset(
565 new OnDataConverter(input_parameters, output_parameters)); 565 new OnDataConverter(input_parameters, output_parameters));
566 566
567 // TODO(xians): use the correct input device here. 567 // TODO(xians): use the correct input device here.
568 audio_controller_ = AudioInputController::Create( 568 audio_controller_ = AudioInputController::Create(
569 audio_manager, this, input_parameters, device_id_); 569 audio_manager, this, input_parameters, device_id_, NULL);
570 570
571 if (!audio_controller_.get()) { 571 if (!audio_controller_.get()) {
572 return Abort(SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO)); 572 return Abort(SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO));
573 } 573 }
574 574
575 // The endpointer needs to estimate the environment/background noise before 575 // The endpointer needs to estimate the environment/background noise before
576 // starting to treat the audio as user input. We wait in the state 576 // starting to treat the audio as user input. We wait in the state
577 // ESTIMATING_ENVIRONMENT until such interval has elapsed before switching 577 // ESTIMATING_ENVIRONMENT until such interval has elapsed before switching
578 // to user input mode. 578 // to user input mode.
579 endpointer_.SetEnvironmentEstimationMode(); 579 endpointer_.SetEnvironmentEstimationMode();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) 812 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value)
813 : event(event_value), 813 : event(event_value),
814 audio_data(NULL), 814 audio_data(NULL),
815 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { 815 engine_error(SPEECH_RECOGNITION_ERROR_NONE) {
816 } 816 }
817 817
818 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { 818 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() {
819 } 819 }
820 820
821 } // namespace content 821 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698