Loading ivas_processing_scripts/processing/chains.py +15 −8 Original line number Diff line number Diff line Loading @@ -578,9 +578,9 @@ def validate_input_files(cfg: TestConfig): if frame_alignment == "padding": # Create new input directory for padded files output_dir = cfg.output_path / "20ms_aligned_files" aligned_output_dir = cfg.output_path / "20ms_aligned_files" try: output_dir.mkdir(exist_ok=False, parents=True) aligned_output_dir.mkdir(exist_ok=False, parents=True) except FileExistsError: raise ValueError( "Folder for 20ms aligned files already exists. Please move or delete folder" Loading Loading @@ -639,24 +639,31 @@ def validate_input_files(cfg: TestConfig): samples=True, ) # Write padded data to output directory write(output_dir / item.name, padded_data, fs) write(aligned_output_dir / item.name, padded_data, fs) # Update audio file path in list cfg.items_list[i] = output_dir / item.name cfg.items_list[i] = aligned_output_dir / item.name else: raise ValueError( f"Value of key frame_alignment does not match possible options. Value: {frame_alignment}. Options: 'padding', 'ignore', 'warning', 'error'" ) else: if frame_alignment == "padding": copyfile(item, output_dir / item.name) copyfile(item, aligned_output_dir / item.name) # Update audio file path in list cfg.items_list[i] = output_dir / item.name cfg.items_list[i] = aligned_output_dir / item.name else: pass if frame_alignment == "padding": # copy over any metadata files [ copyfile(f, aligned_output_dir / f.name) for f in list(cfg.input_path.glob("*.csv")) + list(cfg.input_path.glob("*.met")) ] # Make the output path as the new input path cfg.input_path = output_dir cfg.input_path = aligned_output_dir def clean_outputs(cfg: TestConfig) -> None: Loading Loading
ivas_processing_scripts/processing/chains.py +15 −8 Original line number Diff line number Diff line Loading @@ -578,9 +578,9 @@ def validate_input_files(cfg: TestConfig): if frame_alignment == "padding": # Create new input directory for padded files output_dir = cfg.output_path / "20ms_aligned_files" aligned_output_dir = cfg.output_path / "20ms_aligned_files" try: output_dir.mkdir(exist_ok=False, parents=True) aligned_output_dir.mkdir(exist_ok=False, parents=True) except FileExistsError: raise ValueError( "Folder for 20ms aligned files already exists. Please move or delete folder" Loading Loading @@ -639,24 +639,31 @@ def validate_input_files(cfg: TestConfig): samples=True, ) # Write padded data to output directory write(output_dir / item.name, padded_data, fs) write(aligned_output_dir / item.name, padded_data, fs) # Update audio file path in list cfg.items_list[i] = output_dir / item.name cfg.items_list[i] = aligned_output_dir / item.name else: raise ValueError( f"Value of key frame_alignment does not match possible options. Value: {frame_alignment}. Options: 'padding', 'ignore', 'warning', 'error'" ) else: if frame_alignment == "padding": copyfile(item, output_dir / item.name) copyfile(item, aligned_output_dir / item.name) # Update audio file path in list cfg.items_list[i] = output_dir / item.name cfg.items_list[i] = aligned_output_dir / item.name else: pass if frame_alignment == "padding": # copy over any metadata files [ copyfile(f, aligned_output_dir / f.name) for f in list(cfg.input_path.glob("*.csv")) + list(cfg.input_path.glob("*.met")) ] # Make the output path as the new input path cfg.input_path = output_dir cfg.input_path = aligned_output_dir def clean_outputs(cfg: TestConfig) -> None: Loading