| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 99 }  // namespace | 99 }  // namespace | 
| 100 | 100 | 
| 101 const int SpeechRecognizerImpl::kAudioSampleRate = 16000; | 101 const int SpeechRecognizerImpl::kAudioSampleRate = 16000; | 
| 102 const ChannelLayout SpeechRecognizerImpl::kChannelLayout = | 102 const ChannelLayout SpeechRecognizerImpl::kChannelLayout = | 
| 103     media::CHANNEL_LAYOUT_MONO; | 103     media::CHANNEL_LAYOUT_MONO; | 
| 104 const int SpeechRecognizerImpl::kNumBitsPerAudioSample = 16; | 104 const int SpeechRecognizerImpl::kNumBitsPerAudioSample = 16; | 
| 105 const int SpeechRecognizerImpl::kNoSpeechTimeoutMs = 8000; | 105 const int SpeechRecognizerImpl::kNoSpeechTimeoutMs = 8000; | 
| 106 const int SpeechRecognizerImpl::kEndpointerEstimationTimeMs = 300; | 106 const int SpeechRecognizerImpl::kEndpointerEstimationTimeMs = 300; | 
| 107 media::AudioManager* SpeechRecognizerImpl::audio_manager_for_tests_ = NULL; | 107 media::AudioManager* SpeechRecognizerImpl::audio_manager_for_tests_ = NULL; | 
| 108 | 108 | 
| 109 COMPILE_ASSERT(SpeechRecognizerImpl::kNumBitsPerAudioSample % 8 == 0, | 109 static_assert(SpeechRecognizerImpl::kNumBitsPerAudioSample % 8 == 0, | 
| 110                kNumBitsPerAudioSample_must_be_a_multiple_of_8); | 110               "kNumBitsPerAudioSample must be a multiple of 8"); | 
| 111 | 111 | 
| 112 // SpeechRecognizerImpl::OnDataConverter implementation | 112 // SpeechRecognizerImpl::OnDataConverter implementation | 
| 113 | 113 | 
| 114 SpeechRecognizerImpl::OnDataConverter::OnDataConverter( | 114 SpeechRecognizerImpl::OnDataConverter::OnDataConverter( | 
| 115     const AudioParameters& input_params, | 115     const AudioParameters& input_params, | 
| 116     const AudioParameters& output_params) | 116     const AudioParameters& output_params) | 
| 117     : audio_converter_(input_params, output_params, false), | 117     : audio_converter_(input_params, output_params, false), | 
| 118       input_bus_(AudioBus::Create(input_params)), | 118       input_bus_(AudioBus::Create(input_params)), | 
| 119       output_bus_(AudioBus::Create(output_params)), | 119       output_bus_(AudioBus::Create(output_params)), | 
| 120       input_parameters_(input_params), | 120       input_parameters_(input_params), | 
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 809 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) | 809 SpeechRecognizerImpl::FSMEventArgs::FSMEventArgs(FSMEvent event_value) | 
| 810     : event(event_value), | 810     : event(event_value), | 
| 811       audio_data(NULL), | 811       audio_data(NULL), | 
| 812       engine_error(SPEECH_RECOGNITION_ERROR_NONE) { | 812       engine_error(SPEECH_RECOGNITION_ERROR_NONE) { | 
| 813 } | 813 } | 
| 814 | 814 | 
| 815 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { | 815 SpeechRecognizerImpl::FSMEventArgs::~FSMEventArgs() { | 
| 816 } | 816 } | 
| 817 | 817 | 
| 818 }  // namespace content | 818 }  // namespace content | 
| OLD | NEW | 
|---|