OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """Generate .json files with which the APM module can be tested using the | 10 """Generate .json files with which the APM module can be tested using the |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 config_filename)) | 54 config_filename)) |
55 logging.debug('config file <%s> | %s', config_filepath, config) | 55 logging.debug('config file <%s> | %s', config_filepath, config) |
56 | 56 |
57 data_access.AudioProcConfigFile.Save(config_filepath, config) | 57 data_access.AudioProcConfigFile.Save(config_filepath, config) |
58 logging.info('config file created: <%s>', config_filepath) | 58 logging.info('config file created: <%s>', config_filepath) |
59 | 59 |
60 | 60 |
61 def _GenerateAllDefaultButOne(): | 61 def _GenerateAllDefaultButOne(): |
62 """Disables the flags enabled by default one-by-one. | 62 """Disables the flags enabled by default one-by-one. |
63 """ | 63 """ |
64 CONFIG_SETS = { | 64 config_sets = { |
65 'no_AEC': {'-aec': 0,}, | 65 'no_AEC': {'-aec': 0,}, |
66 'no_AGC': {'-agc': 0,}, | 66 'no_AGC': {'-agc': 0,}, |
67 'no_HP_filter': {'-hpf': 0,}, | 67 'no_HP_filter': {'-hpf': 0,}, |
68 'no_level_estimator': {'-le': 0,}, | 68 'no_level_estimator': {'-le': 0,}, |
69 'no_noise_suppressor': {'-ns': 0,}, | 69 'no_noise_suppressor': {'-ns': 0,}, |
70 'no_transient_suppressor': {'-ts': 0,}, | 70 'no_transient_suppressor': {'-ts': 0,}, |
71 'no_vad': {'-vad': 0,}, | 71 'no_vad': {'-vad': 0,}, |
72 } | 72 } |
73 _GenerateDefaultOverridden(CONFIG_SETS) | 73 _GenerateDefaultOverridden(config_sets) |
74 | 74 |
75 | 75 |
76 def _GenerateAllDefaultPlusOne(): | 76 def _GenerateAllDefaultPlusOne(): |
77 """Enables the flags disabled by default one-by-one. | 77 """Enables the flags disabled by default one-by-one. |
78 """ | 78 """ |
79 CONFIG_SETS = { | 79 config_sets = { |
80 'with_AECM': {'-aec': 0, '-aecm': 1,}, # AEC and AECM are exclusive. | 80 'with_AECM': {'-aec': 0, '-aecm': 1,}, # AEC and AECM are exclusive. |
81 'with_AGC_limiter': {'-agc_limiter': 1,}, | 81 'with_AGC_limiter': {'-agc_limiter': 1,}, |
82 'with_AEC_delay_agnostic': {'-delay_agnostic': 1,}, | 82 'with_AEC_delay_agnostic': {'-delay_agnostic': 1,}, |
83 'with_drift_compensation': {'-drift_compensation': 1,}, | 83 'with_drift_compensation': {'-drift_compensation': 1,}, |
84 'with_residual_echo_detector': {'-ed': 1,}, | 84 'with_residual_echo_detector': {'-ed': 1,}, |
85 'with_AEC_extended_filter': {'-extended_filter': 1,}, | 85 'with_AEC_extended_filter': {'-extended_filter': 1,}, |
86 'with_intelligibility_enhancer': {'-ie': 1,}, | 86 'with_intelligibility_enhancer': {'-ie': 1,}, |
87 'with_LC': {'-lc': 1,}, | 87 'with_LC': {'-lc': 1,}, |
88 'with_refined_adaptive_filter': {'-refined_adaptive_filter': 1,}, | 88 'with_refined_adaptive_filter': {'-refined_adaptive_filter': 1,}, |
89 } | 89 } |
90 _GenerateDefaultOverridden(CONFIG_SETS) | 90 _GenerateDefaultOverridden(config_sets) |
91 | 91 |
92 | 92 |
93 def main(): | 93 def main(): |
94 logging.basicConfig(level=logging.INFO) | 94 logging.basicConfig(level=logging.INFO) |
95 _GenerateAllDefaultPlusOne() | 95 _GenerateAllDefaultPlusOne() |
96 _GenerateAllDefaultButOne() | 96 _GenerateAllDefaultButOne() |
97 | 97 |
98 | 98 |
99 if __name__ == '__main__': | 99 if __name__ == '__main__': |
100 main() | 100 main() |
OLD | NEW |