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 // Implementation of AudioInputStream for Windows using Windows Core Audio | 5 // Implementation of AudioInputStream for Windows using Windows Core Audio |
6 // WASAPI for low latency capturing. | 6 // WASAPI for low latency capturing. |
7 // | 7 // |
8 // Overview of operation: | 8 // Overview of operation: |
9 // | 9 // |
10 // - An object of WASAPIAudioInputStream is created by the AudioManager | 10 // - An object of WASAPIAudioInputStream is created by the AudioManager |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 const std::string& device_id); | 81 const std::string& device_id); |
82 // The dtor is typically called by the AudioManager only and it is usually | 82 // The dtor is typically called by the AudioManager only and it is usually |
83 // triggered by calling AudioInputStream::Close(). | 83 // triggered by calling AudioInputStream::Close(). |
84 virtual ~WASAPIAudioInputStream(); | 84 virtual ~WASAPIAudioInputStream(); |
85 | 85 |
86 // Implementation of AudioInputStream. | 86 // Implementation of AudioInputStream. |
87 virtual bool Open() OVERRIDE; | 87 virtual bool Open() OVERRIDE; |
88 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 88 virtual void Start(AudioInputCallback* callback) OVERRIDE; |
89 virtual void Stop() OVERRIDE; | 89 virtual void Stop() OVERRIDE; |
90 virtual void Close() OVERRIDE; | 90 virtual void Close() OVERRIDE; |
| 91 virtual double GetMaxVolume() OVERRIDE; |
| 92 virtual void SetVolume(double volume) OVERRIDE; |
| 93 virtual double GetVolume() OVERRIDE; |
91 | 94 |
92 // Retrieves the sample rate used by the audio engine for its internal | 95 // Retrieves the sample rate used by the audio engine for its internal |
93 // processing/mixing of shared-mode streams. | 96 // processing/mixing of shared-mode streams. |
94 static double HardwareSampleRate(ERole device_role); | 97 static double HardwareSampleRate(ERole device_role); |
95 | 98 |
96 // Retrieves the number of audio channels used by the audio engine for its | 99 // Retrieves the number of audio channels used by the audio engine for its |
97 // internal processing/mixing of shared-mode streams. | 100 // internal processing/mixing of shared-mode streams. |
98 static uint32 HardwareChannelCount(ERole device_role); | 101 static uint32 HardwareChannelCount(ERole device_role); |
99 | 102 |
100 bool started() const { return started_; } | 103 bool started() const { return started_; } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // recorded. | 187 // recorded. |
185 base::win::ScopedHandle audio_samples_ready_event_; | 188 base::win::ScopedHandle audio_samples_ready_event_; |
186 | 189 |
187 // This event will be signaled when capturing shall stop. | 190 // This event will be signaled when capturing shall stop. |
188 base::win::ScopedHandle stop_capture_event_; | 191 base::win::ScopedHandle stop_capture_event_; |
189 | 192 |
190 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); | 193 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); |
191 }; | 194 }; |
192 | 195 |
193 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ | 196 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ |
OLD | NEW |