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(), | |
212 sample_rate(), bits_per_sample(), frames_per_buffer_, | 211 sample_rate(), bits_per_sample(), frames_per_buffer_, |
213 default_params_.effects()), | 212 default_params_.effects()), |
214 AudioManagerBase::kDefaultDeviceId); | 213 AudioManagerBase::kDefaultDeviceId); |
215 EXPECT_TRUE(ais); | 214 EXPECT_TRUE(ais); |
216 return ais; | 215 return ais; |
217 } | 216 } |
218 | 217 |
219 ScopedCOMInitializer com_init_; | 218 ScopedCOMInitializer com_init_; |
220 AudioManager* audio_man_; | 219 AudioManager* audio_man_; |
221 const AudioParameters default_params_; | 220 const AudioParameters default_params_; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); | 486 WriteToFileAudioSink file_sink(file_name, aisw.bits_per_sample()); |
488 VLOG(0) << ">> Speak into the default microphone while recording."; | 487 VLOG(0) << ">> Speak into the default microphone while recording."; |
489 ais->Start(&file_sink); | 488 ais->Start(&file_sink); |
490 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 489 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
491 ais->Stop(); | 490 ais->Stop(); |
492 VLOG(0) << ">> Recording has stopped."; | 491 VLOG(0) << ">> Recording has stopped."; |
493 ais.Close(); | 492 ais.Close(); |
494 } | 493 } |
495 | 494 |
496 } // namespace media | 495 } // namespace media |
OLD | NEW |