Chromium Code Reviews| Index: webrtc/audio/test/low_bandwidth_audio_test.cc |
| diff --git a/webrtc/audio/test/low_bandwidth_audio_test.cc b/webrtc/audio/test/low_bandwidth_audio_test.cc |
| index 65f28fa6a3385ccc2c30dbbac9ad332910202f54..c5dc6d3628a5571159bfd168b99ee8315650716e 100644 |
| --- a/webrtc/audio/test/low_bandwidth_audio_test.cc |
| +++ b/webrtc/audio/test/low_bandwidth_audio_test.cc |
| @@ -10,6 +10,7 @@ |
| #include <algorithm> |
| +#include "gflags/gflags.h" |
| #include "webrtc/audio/test/low_bandwidth_audio_test.h" |
| #include "webrtc/common_audio/wav_file.h" |
| #include "webrtc/test/gtest.h" |
| @@ -20,8 +21,8 @@ namespace { |
| // Wait half a second between stopping sending and stopping receiving audio. |
| constexpr int kExtraRecordTimeMs = 500; |
| -// The best that can be done with PESQ. |
| -constexpr int kAudioFileBitRate = 16000; |
| +DEFINE_int32(sampling_frequency, 16000, |
|
kwiberg-webrtc
2017/04/12 07:13:49
As always, I'm going to suggest that you call this
oprypin_webrtc
2017/04/12 11:24:56
Done.
|
| + "Sampling frequency (Hz) of the produced audio files."); |
|
kwiberg-webrtc
2017/04/12 07:13:49
Look it up before you take my advice because I'm n
oprypin_webrtc
2017/04/12 11:24:56
OK. Indeed, flags are usually put in the global na
|
| } // namespace |
| namespace webrtc { |
| @@ -41,14 +42,16 @@ size_t AudioQualityTest::GetNumFlexfecStreams() const { |
| } |
| std::string AudioQualityTest::AudioInputFile() { |
| - return test::ResourcePath("voice_engine/audio_tiny16", "wav"); |
| + return test::ResourcePath("voice_engine/audio_tiny" + |
| + std::to_string(FLAGS_sampling_frequency / 1000), |
| + "wav"); |
| } |
| std::string AudioQualityTest::AudioOutputFile() { |
| const ::testing::TestInfo* const test_info = |
| ::testing::UnitTest::GetInstance()->current_test_info(); |
| - return webrtc::test::OutputPath() + |
| - "LowBandwidth_" + test_info->name() + ".wav"; |
| + return webrtc::test::OutputPath() + "LowBandwidth_" + test_info->name() + |
| + "_" + std::to_string(FLAGS_sampling_frequency / 1000) + ".wav"; |
|
kwiberg-webrtc
2017/04/12 07:13:49
You construct this name more than once. Utility fu
oprypin_webrtc
2017/04/12 11:24:56
Done.
|
| } |
| std::unique_ptr<test::FakeAudioDevice::Capturer> |
| @@ -59,7 +62,7 @@ std::unique_ptr<test::FakeAudioDevice::Capturer> |
| std::unique_ptr<test::FakeAudioDevice::Renderer> |
| AudioQualityTest::CreateRenderer() { |
| return test::FakeAudioDevice::CreateBoundedWavFileWriter( |
| - AudioOutputFile(), kAudioFileBitRate); |
| + AudioOutputFile(), FLAGS_sampling_frequency); |
| } |
| void AudioQualityTest::OnFakeAudioDevicesCreated( |