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_ENCODER_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ |
6 #define CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ | 6 #define CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
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/browser/speech/audio_buffer.h" | 13 #include "content/browser/speech/audio_buffer.h" |
14 | 14 |
15 namespace speech { | 15 namespace content{ |
16 class AudioChunk; | 16 class AudioChunk; |
| 17 |
17 // Provides a simple interface to encode raw audio using the various speech | 18 // Provides a simple interface to encode raw audio using the various speech |
18 // codecs. | 19 // codecs. |
19 class AudioEncoder { | 20 class AudioEncoder { |
20 public: | 21 public: |
21 enum Codec { | 22 enum Codec { |
22 CODEC_FLAC, | 23 CODEC_FLAC, |
23 CODEC_SPEEX, | 24 CODEC_SPEEX, |
24 }; | 25 }; |
25 | 26 |
26 static AudioEncoder* Create(Codec codec, | 27 static AudioEncoder* Create(Codec codec, |
(...skipping 20 matching lines...) Expand all Loading... |
47 AudioEncoder(const std::string& mime_type, int bits_per_sample); | 48 AudioEncoder(const std::string& mime_type, int bits_per_sample); |
48 AudioBuffer encoded_audio_buffer_; | 49 AudioBuffer encoded_audio_buffer_; |
49 | 50 |
50 private: | 51 private: |
51 std::string mime_type_; | 52 std::string mime_type_; |
52 int bits_per_sample_; | 53 int bits_per_sample_; |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); | 55 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace speech | 58 } // namespace content |
58 | 59 |
59 #endif // CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ | 60 #endif // CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ |
OLD | NEW |