Loading ivas_processing_scripts/__init__.py +1 −7 Original line number Diff line number Diff line Loading @@ -156,12 +156,6 @@ def main(args): # save process info to revert it later cfg.pre2 = cfg.proc_chains[0]["processes"][0] # preprocess background noise if ( hasattr(cfg, "preprocessing") and hasattr(cfg.pre2, "background_noise") and cfg.pre2.background_noise is not None and cfg.pre2.background_noise.get("background_noise_path") ): preprocess_background_noise(cfg) # preprocess 2 preprocess_2(cfg, logger) Loading ivas_processing_scripts/processing/preprocessing_2.py +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ class Preprocessing2(Processing): raise ValueError( f"Background noise path {self.background_noise.get('background_noise_path')} does not exist" ) # load background noise # load preprocessed background noise if self.background_noise["background_object"] is not None: noise_object = self.background_noise["background_object"] else: Loading ivas_processing_scripts/processing/processing.py +12 −3 Original line number Diff line number Diff line Loading @@ -569,7 +569,14 @@ def remove_preamble(x, out_fmt, fs, repeat_signal, preamble_len_ms, meta, logger def preprocess_background_noise(cfg): # TODO: add checks and errors for sampling rate and number channels compared to input signals if not ( hasattr(cfg, "preprocessing") and hasattr(cfg.pre2, "background_noise") and cfg.pre2.background_noise is not None and cfg.pre2.background_noise.get("background_noise_path") ): return # create audio objects input_audio = audio.fromfile( cfg.input["fmt"], Loading @@ -583,7 +590,10 @@ def preprocess_background_noise(cfg): else: out_fs = cfg.pre.out_fs # only consider format conversion, resampling and high-pass filtering if hasattr(input_audio, "object_pos"): output_audio.object_pos = input_audio.object_pos # only apply format conversion, resampling and filtering convert( input=input_audio, output=output_audio, Loading @@ -593,7 +603,6 @@ def preprocess_background_noise(cfg): ) # save result in cfg # cfg.preprocessing_2["background_noise"].update({"background_object": output_audio}) cfg.proc_chains[0]["processes"][0].background_noise[ "background_object" ] = output_audio Loading Loading
ivas_processing_scripts/__init__.py +1 −7 Original line number Diff line number Diff line Loading @@ -156,12 +156,6 @@ def main(args): # save process info to revert it later cfg.pre2 = cfg.proc_chains[0]["processes"][0] # preprocess background noise if ( hasattr(cfg, "preprocessing") and hasattr(cfg.pre2, "background_noise") and cfg.pre2.background_noise is not None and cfg.pre2.background_noise.get("background_noise_path") ): preprocess_background_noise(cfg) # preprocess 2 preprocess_2(cfg, logger) Loading
ivas_processing_scripts/processing/preprocessing_2.py +1 −1 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ class Preprocessing2(Processing): raise ValueError( f"Background noise path {self.background_noise.get('background_noise_path')} does not exist" ) # load background noise # load preprocessed background noise if self.background_noise["background_object"] is not None: noise_object = self.background_noise["background_object"] else: Loading
ivas_processing_scripts/processing/processing.py +12 −3 Original line number Diff line number Diff line Loading @@ -569,7 +569,14 @@ def remove_preamble(x, out_fmt, fs, repeat_signal, preamble_len_ms, meta, logger def preprocess_background_noise(cfg): # TODO: add checks and errors for sampling rate and number channels compared to input signals if not ( hasattr(cfg, "preprocessing") and hasattr(cfg.pre2, "background_noise") and cfg.pre2.background_noise is not None and cfg.pre2.background_noise.get("background_noise_path") ): return # create audio objects input_audio = audio.fromfile( cfg.input["fmt"], Loading @@ -583,7 +590,10 @@ def preprocess_background_noise(cfg): else: out_fs = cfg.pre.out_fs # only consider format conversion, resampling and high-pass filtering if hasattr(input_audio, "object_pos"): output_audio.object_pos = input_audio.object_pos # only apply format conversion, resampling and filtering convert( input=input_audio, output=output_audio, Loading @@ -593,7 +603,6 @@ def preprocess_background_noise(cfg): ) # save result in cfg # cfg.preprocessing_2["background_noise"].update({"background_object": output_audio}) cfg.proc_chains[0]["processes"][0].background_noise[ "background_object" ] = output_audio Loading