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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 ReadFromFileAudioSource file_source(file_name); | 425 ReadFromFileAudioSource file_source(file_name); |
426 | 426 |
427 DVLOG(0) << "File name : " << file_name.c_str(); | 427 DVLOG(0) << "File name : " << file_name.c_str(); |
428 DVLOG(0) << "Sample rate : " << aosw.sample_rate(); | 428 DVLOG(0) << "Sample rate : " << aosw.sample_rate(); |
429 DVLOG(0) << "Bits per sample: " << aosw.bits_per_sample(); | 429 DVLOG(0) << "Bits per sample: " << aosw.bits_per_sample(); |
430 DVLOG(0) << "#channels : " << aosw.channels(); | 430 DVLOG(0) << "#channels : " << aosw.channels(); |
431 DVLOG(0) << "File size : " << file_source.file_size(); | 431 DVLOG(0) << "File size : " << file_source.file_size(); |
432 DVLOG(0) << "#file segments : " << kNumFileSegments; | 432 DVLOG(0) << "#file segments : " << kNumFileSegments; |
433 DVLOG(0) << ">> Listen to the stereo file while playing..."; | 433 DVLOG(0) << ">> Listen to the stereo file while playing..."; |
434 | 434 |
435 for (int i = 0; i < kNumFileSegments; i++) { | 435 for (size_t i = 0; i < kNumFileSegments; i++) { |
436 // Each segment will start with a short (~20ms) block of zeros, hence | 436 // Each segment will start with a short (~20ms) block of zeros, hence |
437 // some short glitches might be heard in this test if kNumFileSegments | 437 // some short glitches might be heard in this test if kNumFileSegments |
438 // is larger than one. The exact length of the silence period depends on | 438 // is larger than one. The exact length of the silence period depends on |
439 // the selected sample rate. | 439 // the selected sample rate. |
440 aos->Start(&file_source); | 440 aos->Start(&file_source); |
441 base::PlatformThread::Sleep( | 441 base::PlatformThread::Sleep( |
442 base::TimeDelta::FromMilliseconds(kFileDurationMs / kNumFileSegments)); | 442 base::TimeDelta::FromMilliseconds(kFileDurationMs / kNumFileSegments)); |
443 aos->Stop(); | 443 aos->Stop(); |
444 } | 444 } |
445 | 445 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 | 617 |
618 aos->Start(&source); | 618 aos->Start(&source); |
619 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), | 619 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
620 TestTimeouts::action_timeout()); | 620 TestTimeouts::action_timeout()); |
621 loop.Run(); | 621 loop.Run(); |
622 aos->Stop(); | 622 aos->Stop(); |
623 aos->Close(); | 623 aos->Close(); |
624 } | 624 } |
625 | 625 |
626 } // namespace media | 626 } // namespace media |
OLD | NEW |