OLD | NEW |
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/audio_buffer.h" | |
6 #include "content/browser/speech/endpointer/endpointer.h" | 5 #include "content/browser/speech/endpointer/endpointer.h" |
7 | 6 |
8 #include "base/time.h" | 7 #include "base/time.h" |
| 8 #include "content/browser/speech/audio_buffer.h" |
9 | 9 |
10 using base::Time; | 10 using base::Time; |
11 | 11 |
12 namespace { | 12 namespace { |
13 static const int kFrameRate = 50; // 1 frame = 20ms of audio. | 13 const int kFrameRate = 50; // 1 frame = 20ms of audio. |
14 } | 14 } |
15 | 15 |
16 namespace speech { | 16 namespace content { |
17 | 17 |
18 Endpointer::Endpointer(int sample_rate) | 18 Endpointer::Endpointer(int sample_rate) |
19 : speech_input_possibly_complete_silence_length_us_(-1), | 19 : speech_input_possibly_complete_silence_length_us_(-1), |
20 speech_input_complete_silence_length_us_(-1), | 20 speech_input_complete_silence_length_us_(-1), |
21 audio_frame_time_us_(0), | 21 audio_frame_time_us_(0), |
22 sample_rate_(sample_rate), | 22 sample_rate_(sample_rate), |
23 frame_size_(0) { | 23 frame_size_(0) { |
24 Reset(); | 24 Reset(); |
25 | 25 |
26 frame_size_ = static_cast<int>(sample_rate / static_cast<float>(kFrameRate)); | 26 frame_size_ = static_cast<int>(sample_rate / static_cast<float>(kFrameRate)); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 waiting_for_speech_complete_timeout_ = false; | 159 waiting_for_speech_complete_timeout_ = false; |
160 speech_input_complete_ = true; | 160 speech_input_complete_ = true; |
161 } | 161 } |
162 } | 162 } |
163 } | 163 } |
164 old_ep_status_ = ep_status; | 164 old_ep_status_ = ep_status; |
165 } | 165 } |
166 return ep_status; | 166 return ep_status; |
167 } | 167 } |
168 | 168 |
169 } // namespace speech | 169 } // namespace content |
OLD | NEW |