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 de955f75e19c936b98e61692f832d62254d8ffcc..eae46369578a60a3e578604ba4a6b4a19566cd81 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,7 @@ 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(bitrate, 16000, "Bitrate of the produced audio file."); |
|
kjellander_webrtc
2017/04/07 18:26:12
This should probably be called sampling_frequency
oprypin_webrtc
2017/04/10 12:20:40
Done.
|
| } |
| namespace webrtc { |
| @@ -44,14 +44,15 @@ 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_bitrate / 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_bitrate / 1000) + ".wav"; |
| } |
| std::unique_ptr<test::FakeAudioDevice::Capturer> |
| @@ -62,7 +63,7 @@ std::unique_ptr<test::FakeAudioDevice::Capturer> |
| std::unique_ptr<test::FakeAudioDevice::Renderer> |
| AudioQualityTest::CreateRenderer() { |
| return test::FakeAudioDevice::CreateBoundedWavFileWriter( |
| - AudioOutputFile(), kAudioFileBitRate); |
| + AudioOutputFile(), FLAGS_bitrate); |
| } |
| void AudioQualityTest::OnFakeAudioDevicesCreated( |