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

Unified Diff: webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py

Issue 2813883002: APM QA refactoring: render stream support, echo path simulation, new export engine (Closed)
Patch Set: merge Created 3 years, 5 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/quality_assessment/data_access.py
diff --git a/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py b/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py
index c5db04b83a87b419008fe9a0a25d273eb0e3992a..826a0899abd7830ad03248fe612b449431a8cddb 100644
--- a/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py
+++ b/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/data_access.py
@@ -31,7 +31,7 @@ class Metadata(object):
def __init__(self):
pass
- _AUDIO_TEST_DATA_FILENAME = 'audio_test_data.txt'
+ _AUDIO_TEST_DATA_FILENAME = 'audio_test_data.json'
@classmethod
def LoadAudioTestDataPaths(cls, metadata_path):
@@ -46,23 +46,21 @@ class Metadata(object):
metadata_filepath = os.path.join(
metadata_path, cls._AUDIO_TEST_DATA_FILENAME)
with open(metadata_filepath) as f:
- audio_in_filepath = f.readline().strip()
- audio_ref_filepath = f.readline().strip()
- return audio_in_filepath, audio_ref_filepath
+ return json.load(f)
@classmethod
- def SaveAudioTestDataPaths(cls, output_path, audio_in_filepath,
- audio_ref_filepath):
+ def SaveAudioTestDataPaths(cls, output_path, **filepaths):
"""Saves the input and the reference audio track paths.
Args:
output_path: path to the directory containing the metadata file.
- audio_in_filepath: path to the input audio track file.
- audio_ref_filepath: path to the reference audio track file.
+
+ Keyword Args:
+ filepaths: collection of audio track file paths to save.
"""
output_filepath = os.path.join(output_path, cls._AUDIO_TEST_DATA_FILENAME)
with open(output_filepath, 'w') as f:
- f.write('{}\n{}\n'.format(audio_in_filepath, audio_ref_filepath))
+ json.dump(filepaths, f)
class AudioProcConfigFile(object):

Powered by Google App Engine
This is Rietveld 408576698