Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: webrtc/audio/test/low_bandwidth_audio_test.cc

Issue 2804083003: Add POLQA to low bandwidth audio test (Closed)
Patch Set: Address review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698