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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 return ChannelLayoutToChannelCount(default_params_.channel_layout()); | 201 return ChannelLayoutToChannelCount(default_params_.channel_layout()); |
202 } | 202 } |
203 int bits_per_sample() const { return default_params_.bits_per_sample(); } | 203 int bits_per_sample() const { return default_params_.bits_per_sample(); } |
204 int sample_rate() const { return default_params_.sample_rate(); } | 204 int sample_rate() const { return default_params_.sample_rate(); } |
205 int frames_per_buffer() const { return frames_per_buffer_; } | 205 int frames_per_buffer() const { return frames_per_buffer_; } |
206 | 206 |
207 private: | 207 private: |
208 AudioInputStream* CreateInputStream() { | 208 AudioInputStream* CreateInputStream() { |
209 AudioInputStream* ais = audio_man_->MakeAudioInputStream( | 209 AudioInputStream* ais = audio_man_->MakeAudioInputStream( |
210 AudioParameters(format(), default_params_.channel_layout(), | 210 AudioParameters(format(), default_params_.channel_layout(), |
| 211 default_params_.input_channels(), |
211 sample_rate(), bits_per_sample(), frames_per_buffer_, | 212 sample_rate(), bits_per_sample(), frames_per_buffer_, |
212 default_params_.effects()), | 213 default_params_.effects()), |
213 AudioManagerBase::kDefaultDeviceId); | 214 AudioManagerBase::kDefaultDeviceId); |
214 EXPECT_TRUE(ais); | 215 EXPECT_TRUE(ais); |
215 return ais; | 216 return ais; |
216 } | 217 } |
217 | 218 |
218 ScopedCOMInitializer com_init_; | 219 ScopedCOMInitializer com_init_; |
219 AudioManager* audio_man_; | 220 AudioManager* audio_man_; |
220 const AudioParameters default_params_; | 221 const AudioParameters default_params_; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); | 487 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); |
487 VLOG(0) << ">> Speak into the default microphone while recording."; | 488 VLOG(0) << ">> Speak into the default microphone while recording."; |
488 ais->Start(&file_sink); | 489 ais->Start(&file_sink); |
489 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 490 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
490 ais->Stop(); | 491 ais->Stop(); |
491 VLOG(0) << ">> Recording has stopped."; | 492 VLOG(0) << ">> Recording has stopped."; |
492 ais.Close(); | 493 ais.Close(); |
493 } | 494 } |
494 | 495 |
495 } // namespace media | 496 } // namespace media |
OLD | NEW |