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 |
5 #include "base/logging.h" | 7 #include "base/logging.h" |
6 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
7 #include "content/browser/speech/audio_buffer.h" | |
8 | 9 |
9 namespace speech { | 10 namespace content { |
10 | 11 |
11 AudioChunk::AudioChunk(int bytes_per_sample) | 12 AudioChunk::AudioChunk(int bytes_per_sample) |
12 : bytes_per_sample_(bytes_per_sample) { | 13 : bytes_per_sample_(bytes_per_sample) { |
13 } | 14 } |
14 | 15 |
15 AudioChunk::AudioChunk(const uint8* data, size_t length, int bytes_per_sample) | 16 AudioChunk::AudioChunk(const uint8* data, size_t length, int bytes_per_sample) |
16 : data_string_(reinterpret_cast<const char*>(data), length), | 17 : data_string_(reinterpret_cast<const char*>(data), length), |
17 bytes_per_sample_(bytes_per_sample) { | 18 bytes_per_sample_(bytes_per_sample) { |
18 DCHECK_EQ(length % bytes_per_sample, 0U); | 19 DCHECK_EQ(length % bytes_per_sample, 0U); |
19 } | 20 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 81 } |
81 | 82 |
82 void AudioBuffer::Clear() { | 83 void AudioBuffer::Clear() { |
83 chunks_.clear(); | 84 chunks_.clear(); |
84 } | 85 } |
85 | 86 |
86 bool AudioBuffer::IsEmpty() const { | 87 bool AudioBuffer::IsEmpty() const { |
87 return chunks_.empty(); | 88 return chunks_.empty(); |
88 } | 89 } |
89 | 90 |
90 } // namespace speech | 91 } // namespace content |
OLD | NEW |