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 MEDIA_AUDIO_AUDIO_IO_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_IO_H_ |
6 #define MEDIA_AUDIO_AUDIO_IO_H_ | 6 #define MEDIA_AUDIO_AUDIO_IO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file_path.h" | |
10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "media/base/audio_bus.h" | 12 #include "media/base/audio_bus.h" |
12 | 13 |
13 // Low-level audio output support. To make sound there are 3 objects involved: | 14 // Low-level audio output support. To make sound there are 3 objects involved: |
14 // - AudioSource : produces audio samples on a pull model. Implements | 15 // - AudioSource : produces audio samples on a pull model. Implements |
15 // the AudioSourceCallback interface. | 16 // the AudioSourceCallback interface. |
16 // - AudioOutputStream : uses the AudioSource to render audio on a given | 17 // - AudioOutputStream : uses the AudioSource to render audio on a given |
17 // channel, format and sample frequency configuration. Data from the | 18 // channel, format and sample frequency configuration. Data from the |
18 // AudioSource is delivered in a 'pull' model. | 19 // AudioSource is delivered in a 'pull' model. |
19 // - AudioManager : factory for the AudioOutputStream objects, manager | 20 // - AudioManager : factory for the AudioOutputStream objects, manager |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 // the callback object that was supplied to Start() and it can be safely | 100 // the callback object that was supplied to Start() and it can be safely |
100 // deleted. | 101 // deleted. |
101 virtual void Stop() = 0; | 102 virtual void Stop() = 0; |
102 | 103 |
103 // Sets the relative volume, with range [0.0, 1.0] inclusive. | 104 // Sets the relative volume, with range [0.0, 1.0] inclusive. |
104 virtual void SetVolume(double volume) = 0; | 105 virtual void SetVolume(double volume) = 0; |
105 | 106 |
106 // Gets the relative volume, with range [0.0, 1.0] inclusive. | 107 // Gets the relative volume, with range [0.0, 1.0] inclusive. |
107 virtual void GetVolume(double* volume) = 0; | 108 virtual void GetVolume(double* volume) = 0; |
108 | 109 |
110 // Enable debug recording. A file type extension is added to |file_name|. | |
DaleCurtis
2017/01/19 17:44:34
Hmm this is an API only AudioManager should use, s
Henrik Grunell
2017/01/19 20:32:39
How could AudioOutputResampler do this without an
DaleCurtis
2017/01/19 22:37:29
AODI is only used for fake streams these days, so
Henrik Grunell
2017/01/20 10:38:56
Oh, I think you mean that recording is done in AOR
DaleCurtis
2017/01/20 17:52:20
Yeah, stuff like the rebuffering in OSX wouldn't b
| |
111 virtual void EnableDebugRecording(const base::FilePath& file_name) = 0; | |
112 | |
113 // Disable debug recording. | |
114 virtual void DisableDebugRecording() = 0; | |
115 | |
109 // Close the stream. This also generates AudioSourceCallback::OnClose(). | 116 // Close the stream. This also generates AudioSourceCallback::OnClose(). |
110 // After calling this method, the object should not be used anymore. | 117 // After calling this method, the object should not be used anymore. |
111 virtual void Close() = 0; | 118 virtual void Close() = 0; |
112 }; | 119 }; |
113 | 120 |
114 // Models an audio sink receiving recorded audio from the audio driver. | 121 // Models an audio sink receiving recorded audio from the audio driver. |
115 class MEDIA_EXPORT AudioInputStream { | 122 class MEDIA_EXPORT AudioInputStream { |
116 public: | 123 public: |
117 class MEDIA_EXPORT AudioInputCallback { | 124 class MEDIA_EXPORT AudioInputCallback { |
118 public: | 125 public: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 // Returns the Automatic Gain Control (AGC) state. | 184 // Returns the Automatic Gain Control (AGC) state. |
178 virtual bool GetAutomaticGainControl() = 0; | 185 virtual bool GetAutomaticGainControl() = 0; |
179 | 186 |
180 // Returns the current muting state for the microphone. | 187 // Returns the current muting state for the microphone. |
181 virtual bool IsMuted() = 0; | 188 virtual bool IsMuted() = 0; |
182 }; | 189 }; |
183 | 190 |
184 } // namespace media | 191 } // namespace media |
185 | 192 |
186 #endif // MEDIA_AUDIO_AUDIO_IO_H_ | 193 #endif // MEDIA_AUDIO_AUDIO_IO_H_ |
OLD | NEW |