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 de955f75e19c936b98e61692f832d62254d8ffcc..bd2dc384ddd39a7f53813a1cbd18b85bad337f75 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" |
@@ -23,8 +24,8 @@ constexpr int kExtraRecordTimeMs = 500; |
// Large bitrate by default. |
const webrtc::CodecInst kDefaultCodec{120, "OPUS", 48000, 960, 2, 64000}; |
-// The best that can be done with PESQ. |
-constexpr int kAudioFileBitRate = 16000; |
+DEFINE_int32(sampling_frequency, 16000, |
+ "Sampling frequency (Hz) of the produced audio files."); |
} |
namespace webrtc { |
@@ -44,14 +45,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"; |
} |
std::unique_ptr<test::FakeAudioDevice::Capturer> |
@@ -62,7 +65,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( |