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 #ifndef CONTENT_BROWSER_SPEECH_AUDIO_BUFFER_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_AUDIO_BUFFER_H_ |
6 #define CONTENT_BROWSER_SPEECH_AUDIO_BUFFER_H_ | 6 #define CONTENT_BROWSER_SPEECH_AUDIO_BUFFER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 namespace speech { | 15 namespace content { |
16 | 16 |
17 // Models a chunk derived from an AudioBuffer. | 17 // Models a chunk derived from an AudioBuffer. |
18 class CONTENT_EXPORT AudioChunk : | 18 class CONTENT_EXPORT AudioChunk : |
19 public base::RefCountedThreadSafe<AudioChunk> { | 19 public base::RefCountedThreadSafe<AudioChunk> { |
20 public: | 20 public: |
21 explicit AudioChunk(int bytes_per_sample); | 21 explicit AudioChunk(int bytes_per_sample); |
22 AudioChunk(const uint8* data, size_t length, int bytes_per_sample); | 22 AudioChunk(const uint8* data, size_t length, int bytes_per_sample); |
23 | 23 |
24 bool IsEmpty() const; | 24 bool IsEmpty() const; |
25 int bytes_per_sample() const { return bytes_per_sample_; } | 25 int bytes_per_sample() const { return bytes_per_sample_; } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 bool IsEmpty() const; | 64 bool IsEmpty() const; |
65 | 65 |
66 private: | 66 private: |
67 typedef std::deque<scoped_refptr<AudioChunk> > ChunksContainer; | 67 typedef std::deque<scoped_refptr<AudioChunk> > ChunksContainer; |
68 ChunksContainer chunks_; | 68 ChunksContainer chunks_; |
69 int bytes_per_sample_; | 69 int bytes_per_sample_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(AudioBuffer); | 71 DISALLOW_COPY_AND_ASSIGN(AudioBuffer); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace speech | 74 } // namespace content |
75 | 75 |
76 #endif // CONTENT_BROWSER_SPEECH_AUDIO_BUFFER_H_ | 76 #endif // CONTENT_BROWSER_SPEECH_AUDIO_BUFFER_H_ |
OLD | NEW |