Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/media/webrtc_browsertest_audio.h" | 5 #include "chrome/browser/media/webrtc_browsertest_audio.h" |
| 6 | 6 |
| 7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "media/audio/audio_parameters.h" | 9 #include "media/audio/audio_parameters.h" |
| 10 #include "media/audio/audio_power_monitor.h" | 10 #include "media/audio/audio_power_monitor.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 // Set the filter coefficient to the whole file's duration; this will make the | 73 // Set the filter coefficient to the whole file's duration; this will make the |
| 74 // power monitor take the entire file into account. | 74 // power monitor take the entire file into account. |
| 75 media::AudioPowerMonitor power_monitor(wav_audio_handler->sample_rate(), | 75 media::AudioPowerMonitor power_monitor(wav_audio_handler->sample_rate(), |
| 76 file_duration); | 76 file_duration); |
| 77 power_monitor.Scan(*audio_bus, audio_bus->frames()); | 77 power_monitor.Scan(*audio_bus, audio_bus->frames()); |
| 78 | 78 |
| 79 file_parameters->Reset( | 79 file_parameters->Reset( |
| 80 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 80 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 81 media::GuessChannelLayout(wav_audio_handler->num_channels()), | 81 media::GuessChannelLayout(wav_audio_handler->num_channels()), |
| 82 wav_audio_handler->num_channels(), wav_audio_handler->sample_rate(), | 82 wav_audio_handler->sample_rate(), wav_audio_handler->bits_per_sample(), |
| 83 wav_audio_handler->bits_per_sample(), wav_audio_handler->total_frames()); | 83 wav_audio_handler->total_frames()); |
| 84 file_parameters->set_channels_for_discrete(wav_audio_handler->num_channels()); | |
|
DaleCurtis
2015/09/04 17:03:39
Hmm, I'm not a fan of this calling pattern, but it
ajm
2015/09/04 19:02:53
Yeah I'm not completely satisfied with it either,
tommi (sloooow) - chröme
2015/09/05 09:49:57
Ack. No better suggestions atm.
| |
| 84 | 85 |
| 85 return power_monitor.ReadCurrentPowerAndClip().first; | 86 return power_monitor.ReadCurrentPowerAndClip().first; |
| 86 } | 87 } |
| 87 | 88 |
| 88 } // namespace test | 89 } // namespace test |
| OLD | NEW |