OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 5 #ifndef MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 6 #define MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
11 #include "media/base/seekable_buffer.h" | 11 #include "media/base/seekable_buffer.h" |
12 | 12 |
| 13 namespace media { |
| 14 |
13 // An audio source that produces a pure sinusoidal tone. | 15 // An audio source that produces a pure sinusoidal tone. |
14 class MEDIA_EXPORT SineWaveAudioSource | 16 class MEDIA_EXPORT SineWaveAudioSource |
15 : public AudioOutputStream::AudioSourceCallback { | 17 : public AudioOutputStream::AudioSourceCallback { |
16 public: | 18 public: |
17 enum Format { | 19 enum Format { |
18 FORMAT_8BIT_LINEAR_PCM, | 20 FORMAT_8BIT_LINEAR_PCM, |
19 FORMAT_16BIT_LINEAR_PCM, | 21 FORMAT_16BIT_LINEAR_PCM, |
20 }; | 22 }; |
21 // |channels| is the number of audio channels, |freq| is the frequency in | 23 // |channels| is the number of audio channels, |freq| is the frequency in |
22 // hertz and it has to be less than half of the sampling frequency | 24 // hertz and it has to be less than half of the sampling frequency |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // Discard all buffered data and reset to initial state. | 83 // Discard all buffered data and reset to initial state. |
82 void ClearAll(); | 84 void ClearAll(); |
83 | 85 |
84 private: | 86 private: |
85 // Free acquired resources. | 87 // Free acquired resources. |
86 void CleanUp(); | 88 void CleanUp(); |
87 | 89 |
88 media::SeekableBuffer buffer_; | 90 media::SeekableBuffer buffer_; |
89 }; | 91 }; |
90 | 92 |
| 93 } // namespace media |
| 94 |
91 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ | 95 #endif // MEDIA_AUDIO_SIMPLE_SOURCES_H_ |
OLD | NEW |