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

Unified Diff: webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py

Issue 2813883002: APM QA refactoring: render stream support, echo path simulation, new export engine (Closed)
Patch Set: removing details about the experiment 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/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
diff --git a/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py b/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
index b495a74f3c5bda26081b546b09721eeac0194f44..ccfcab518e43e36e9424e4a342e1ec5ef8b2e02b 100755
--- a/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
+++ b/webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.py
@@ -23,11 +23,14 @@ import os
import sys
import quality_assessment.audioproc_wrapper as audioproc_wrapper
+import quality_assessment.echo_path_simulation as echo_path_simulation
import quality_assessment.eval_scores as eval_scores
import quality_assessment.evaluation as evaluation
import quality_assessment.test_data_generation as test_data_generation
import quality_assessment.simulation as simulation
+_ECHO_PATH_SIMULATOR_NAMES = (
+ echo_path_simulation.EchoPathSimulator.REGISTERED_CLASSES)
_TEST_DATA_GENERATOR_CLASSES = (
test_data_generation.TestDataGenerator.REGISTERED_CLASSES)
_TEST_DATA_GENERATORS_NAMES = _TEST_DATA_GENERATOR_CLASSES.keys()
@@ -56,6 +59,17 @@ def _InstanceArgumentsParser():
parser.add_argument('-i', '--input_files', nargs='+', required=True,
help='path to the input wav files (one or more)')
+ parser.add_argument('-r', '--reverse_input_files', nargs='+', required=False,
+ help=('path to the reverse input wav files; either '
+ 'omitted or one file for each file in '
+ '--input_files (files will be paired by index)'),
+ default=None)
+
+ parser.add_argument('-p', '--echo_path_simulator', required=False,
+ help=('custom echo path simulator name; required if '
+ '--reverse_input_files is specified'),
+ choices=_ECHO_PATH_SIMULATOR_NAMES, default=None)
+
parser.add_argument('-t', '--test_data_generators', nargs='+', required=False,
help='custom list of test data generators to use',
choices=_TEST_DATA_GENERATORS_NAMES,
@@ -87,6 +101,15 @@ def main():
parser = _InstanceArgumentsParser()
args = parser.parse_args()
+ if args.input_files and args.reverse_input_files and (
+ len(args.input_files) != len(args.reverse_input_files)):
+ parser.error('when --reverse_input_files is set, it has to have the same '
+ 'length of --input_files')
+ sys.exit(1)
+ if args.reverse_input_files and not args.echo_path_simulator:
+ parser.error('when --reverse_input_files is set, --echo_path_simulator is '
+ 'also required')
+ sys.exit(1)
simulator = simulation.ApmModuleSimulator(
aechen_ir_database_path=args.air_db_path,
@@ -96,6 +119,8 @@ def main():
simulator.Run(
config_filepaths=args.config_files,
input_filepaths=args.input_files,
+ reverse_input_filepaths=args.reverse_input_files,
+ echo_path_simulator_name=args.echo_path_simulator,
test_data_generator_names=args.test_data_generators,
eval_score_names=args.eval_scores,
output_dir=args.output_dir)

Powered by Google App Engine
This is Rietveld 408576698