| OLD | NEW |
| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 in_params.bits_per_sample(), | 557 in_params.bits_per_sample(), |
| 558 frames_per_buffer); | 558 frames_per_buffer); |
| 559 } | 559 } |
| 560 | 560 |
| 561 // Create an audio converter which converts data between native input format | 561 // Create an audio converter which converts data between native input format |
| 562 // and WebSpeech specific output format. | 562 // and WebSpeech specific output format. |
| 563 audio_converter_.reset( | 563 audio_converter_.reset( |
| 564 new OnDataConverter(input_parameters, output_parameters)); | 564 new OnDataConverter(input_parameters, output_parameters)); |
| 565 | 565 |
| 566 audio_controller_ = AudioInputController::Create( | 566 audio_controller_ = AudioInputController::Create( |
| 567 audio_manager, this, input_parameters, device_id_); | 567 audio_manager, this, input_parameters, device_id_, NULL); |
| 568 | 568 |
| 569 if (!audio_controller_.get()) { | 569 if (!audio_controller_.get()) { |
| 570 return Abort(SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO)); | 570 return Abort(SpeechRecognitionError(SPEECH_RECOGNITION_ERROR_AUDIO)); |
| 571 } | 571 } |
| 572 | 572 |
| 573 // The endpointer needs to estimate the environment/background noise before | 573 // The endpointer needs to estimate the environment/background noise before |
| 574 // starting to treat the audio as user input. We wait in the state | 574 // starting to treat the audio as user input. We wait in the state |
| 575 // ESTIMATING_ENVIRONMENT until such interval has elapsed before switching | 575 // ESTIMATING_ENVIRONMENT until such interval has elapsed before switching |
| 576 // to user input mode. | 576 // to user input mode. |
| 577 endpointer_.SetEnvironmentEstimationMode(); | 577 endpointer_.SetEnvironmentEstimationMode(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) | 810 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) |
| 811 : event(event_value), | 811 : event(event_value), |
| 812 audio_data(NULL), | 812 audio_data(NULL), |
| 813 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { | 813 engine_error(SPEECH_RECOGNITION_ERROR_NONE) { |
| 814 } | 814 } |
| 815 | 815 |
| 816 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { | 816 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { |
| 817 } | 817 } |
| 818 | 818 |
| 819 } // namespace content | 819 } // namespace content |
| OLD | NEW |