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 #include <windows.h> | 5 #include <windows.h> |
6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 int bits_per_sample() const { return default_params_.bits_per_sample(); } | 190 int bits_per_sample() const { return default_params_.bits_per_sample(); } |
191 int sample_rate() const { return default_params_.sample_rate(); } | 191 int sample_rate() const { return default_params_.sample_rate(); } |
192 int frames_per_buffer() const { return frames_per_buffer_; } | 192 int frames_per_buffer() const { return frames_per_buffer_; } |
193 | 193 |
194 private: | 194 private: |
195 AudioInputStream* CreateInputStream() { | 195 AudioInputStream* CreateInputStream() { |
196 AudioInputStream* ais = audio_man_->MakeAudioInputStream( | 196 AudioInputStream* ais = audio_man_->MakeAudioInputStream( |
197 AudioParameters(format(), default_params_.channel_layout(), | 197 AudioParameters(format(), default_params_.channel_layout(), |
198 sample_rate(), bits_per_sample(), frames_per_buffer_, | 198 sample_rate(), bits_per_sample(), frames_per_buffer_, |
199 default_params_.effects()), | 199 std::vector<Point>(), default_params_.effects()), |
200 AudioManagerBase::kDefaultDeviceId); | 200 AudioManagerBase::kDefaultDeviceId); |
201 EXPECT_TRUE(ais); | 201 EXPECT_TRUE(ais); |
202 return ais; | 202 return ais; |
203 } | 203 } |
204 | 204 |
205 AudioManager* audio_man_; | 205 AudioManager* audio_man_; |
206 AudioParameters default_params_; | 206 AudioParameters default_params_; |
207 int frames_per_buffer_; | 207 int frames_per_buffer_; |
208 }; | 208 }; |
209 | 209 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); | 463 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); |
464 VLOG(0) << ">> Speak into the default microphone while recording."; | 464 VLOG(0) << ">> Speak into the default microphone while recording."; |
465 ais->Start(&file_sink); | 465 ais->Start(&file_sink); |
466 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 466 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
467 ais->Stop(); | 467 ais->Stop(); |
468 VLOG(0) << ">> Recording has stopped."; | 468 VLOG(0) << ">> Recording has stopped."; |
469 ais.Close(); | 469 ais.Close(); |
470 } | 470 } |
471 | 471 |
472 } // namespace media | 472 } // namespace media |
OLD | NEW |