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

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

Issue 2804083003: Add POLQA to low bandwidth audio test (Closed)
Patch Set: Remove unused argument 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
« no previous file with comments | « webrtc/audio/BUILD.gn ('k') | webrtc/audio/test/low_bandwidth_audio_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..98cfa703c3953e1162edd898689a72fd61b6a001 100644
--- a/webrtc/audio/test/low_bandwidth_audio_test.cc
+++ b/webrtc/audio/test/low_bandwidth_audio_test.cc
@@ -10,18 +10,26 @@
#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"
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/test/testsupport/fileutils.h"
+
+DEFINE_int32(sample_rate_hz, 16000,
+ "Sample rate (Hz) of the produced audio files.");
+
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;
+std::string FileSampleRateSuffix() {
+ return std::to_string(FLAGS_sample_rate_hz / 1000);
+}
+
} // namespace
namespace webrtc {
@@ -41,14 +49,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" + FileSampleRateSuffix(),
+ "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() +
+ "_" + FileSampleRateSuffix() + ".wav";
}
std::unique_ptr<test::FakeAudioDevice::Capturer>
@@ -59,7 +68,7 @@ std::unique_ptr<test::FakeAudioDevice::Capturer>
std::unique_ptr<test::FakeAudioDevice::Renderer>
AudioQualityTest::CreateRenderer() {
return test::FakeAudioDevice::CreateBoundedWavFileWriter(
- AudioOutputFile(), kAudioFileBitRate);
+ AudioOutputFile(), FLAGS_sample_rate_hz);
}
void AudioQualityTest::OnFakeAudioDevicesCreated(
« no previous file with comments | « webrtc/audio/BUILD.gn ('k') | webrtc/audio/test/low_bandwidth_audio_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698