OLD | NEW |
1 // Copyright (c) 2010 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 | 12 |
13 namespace speech_input { | 13 namespace speech { |
14 | 14 |
15 // Provides a simple interface to encode raw audio using the various speech | 15 // Provides a simple interface to encode raw audio using the various speech |
16 // codecs. | 16 // codecs. |
17 class AudioEncoder { | 17 class AudioEncoder { |
18 public: | 18 public: |
19 enum Codec { | 19 enum Codec { |
20 CODEC_FLAC, | 20 CODEC_FLAC, |
21 CODEC_SPEEX, | 21 CODEC_SPEEX, |
22 }; | 22 }; |
23 | 23 |
(...skipping 23 matching lines...) Expand all Loading... |
47 void AppendToBuffer(std::string* item); | 47 void AppendToBuffer(std::string* item); |
48 | 48 |
49 private: | 49 private: |
50 // Buffer holding the recorded audio. Owns the strings inside the list. | 50 // Buffer holding the recorded audio. Owns the strings inside the list. |
51 typedef std::list<std::string*> AudioBufferQueue; | 51 typedef std::list<std::string*> AudioBufferQueue; |
52 AudioBufferQueue audio_buffers_; | 52 AudioBufferQueue audio_buffers_; |
53 std::string mime_type_; | 53 std::string mime_type_; |
54 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); | 54 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); |
55 }; | 55 }; |
56 | 56 |
57 } // namespace speech_input | 57 } // namespace speech |
58 | 58 |
59 #endif // CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ | 59 #endif // CONTENT_BROWSER_SPEECH_AUDIO_ENCODER_H_ |
OLD | NEW |