OLD | NEW |
1 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 3 # Use of this source code is governed by a BSD-style license |
4 # that can be found in the LICENSE file in the root of the source | 4 # that can be found in the LICENSE file in the root of the source |
5 # tree. An additional intellectual property rights grant can be found | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 import logging | 9 import logging |
10 import os | 10 import os |
11 | 11 |
| 12 from . import audioproc_wrapper |
12 from . import data_access | 13 from . import data_access |
13 from . import eval_scores | 14 from . import eval_scores |
14 from . import noise_generation | 15 from . import noise_generation |
15 | 16 |
16 class ApmModuleSimulator(object): | 17 class ApmModuleSimulator(object): |
17 | 18 |
18 _NOISE_GENERATOR_CLASSES = noise_generation.NoiseGenerator.REGISTERED_CLASSES | 19 _NOISE_GENERATOR_CLASSES = noise_generation.NoiseGenerator.REGISTERED_CLASSES |
19 _EVAL_SCORE_WORKER_CLASSES = eval_scores.EvaluationScore.REGISTERED_CLASSES | 20 _EVAL_SCORE_WORKER_CLASSES = eval_scores.EvaluationScore.REGISTERED_CLASSES |
20 | 21 |
21 def __init__(self): | 22 def __init__(self): |
| 23 self._audioproc_wrapper = audioproc_wrapper.AudioProcWrapper() |
| 24 |
22 # TODO(alessio): instance when implementation is ready. | 25 # TODO(alessio): instance when implementation is ready. |
23 self._audioproc_wrapper = None | |
24 self._evaluator = None | 26 self._evaluator = None |
25 | 27 |
26 self._base_output_path = None | 28 self._base_output_path = None |
27 self._noise_generators = None | 29 self._noise_generators = None |
28 self._evaluation_score_workers = None | 30 self._evaluation_score_workers = None |
29 self._config_filepaths = None | 31 self._config_filepaths = None |
30 self._input_filepaths = None | 32 self._input_filepaths = None |
31 | 33 |
32 def run(self, config_filepaths, input_filepaths, noise_generator_names, | 34 def run(self, config_filepaths, input_filepaths, noise_generator_names, |
33 eval_score_names, output_dir): | 35 eval_score_names, output_dir): |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 """ | 108 """ |
107 Given a list of file paths, makes a collection with one pair for each item | 109 Given a list of file paths, makes a collection with one pair for each item |
108 in the list where the key is the file name without extension and the value | 110 in the list where the key is the file name without extension and the value |
109 is the path. | 111 is the path. |
110 """ | 112 """ |
111 filepaths_collection = {} | 113 filepaths_collection = {} |
112 for filepath in filepaths: | 114 for filepath in filepaths: |
113 name = os.path.splitext(os.path.split(filepath)[1])[0] | 115 name = os.path.splitext(os.path.split(filepath)[1])[0] |
114 filepaths_collection[name] = os.path.abspath(filepath) | 116 filepaths_collection[name] = os.path.abspath(filepath) |
115 return filepaths_collection | 117 return filepaths_collection |
OLD | NEW |