| 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 90956442e27ab49548604cfcb0f9e86d36351d35..acbe03f9af729c2fe8ea9085bdf6b08fefc59c5c 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
|
| @@ -68,3 +68,22 @@ class AudioProcConfigFile(object):
|
| def save(cls, filepath, config):
|
| with open(filepath, 'w') as f:
|
| json.dump(config, f)
|
| +
|
| +
|
| +class ScoreFile(object):
|
| + """
|
| + Data access class to save and load float scalar scores.
|
| + """
|
| +
|
| + def __init__(self):
|
| + pass
|
| +
|
| + @classmethod
|
| + def load(cls, filepath):
|
| + with open(filepath) as f:
|
| + return float(f.readline().strip())
|
| +
|
| + @classmethod
|
| + def save(cls, filepath, score):
|
| + with open(filepath, 'w') as f:
|
| + f.write('{0:f}\n'.format(score))
|
|
|