From ceb3a31a37b4955e384c95fb66232041714b54cf Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 22 Jul 2025 17:25:30 +0200 Subject: [PATCH 1/5] [fix] copy over metadata files to 20ms aligned output dir if this is created --- ivas_processing_scripts/processing/chains.py | 23 +++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index 84f125a1..405e1bc8 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -575,12 +575,12 @@ def validate_input_files(cfg: TestConfig): # always throw an error for ISM (and MASA) input if input_format.startswith("ISM") or input_format.startswith("MASA"): frame_alignment = "error" - + 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" @@ -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: -- GitLab From 1f2f0c863f766ceba6ad8ad0e00efeb99c0d8884 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 24 Jul 2025 10:57:21 +0200 Subject: [PATCH 2/5] do not set frame_alignment = "error" for OSBA formats --- ivas_processing_scripts/processing/chains.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index 405e1bc8..60f0e37d 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -574,7 +574,15 @@ def validate_input_files(cfg: TestConfig): # always throw an error for ISM (and MASA) input if input_format.startswith("ISM") or input_format.startswith("MASA"): - frame_alignment = "error" + isosb = False + isosba = (input_format in ['ISM1SBA1', 'ISM1SBA2', 'ISM1SBA3', 'ISM2SBA1', 'ISM2SBA2', 'ISM2SBA3', + 'ISM3SBA1', 'ISM3SBA2', 'ISM3SBA3', 'ISM4SBA1', 'ISM4SBA2', 'ISM4SBA3', + 'ISM1PLANARSBA1', 'ISM1PLANARSBA2', 'ISM1PLANARSBA3', 'ISM2PLANARSBA1', + 'ISM2PLANARSBA2', 'ISM2PLANARSBA3', 'ISM3PLANARSBA1', 'ISM3PLANARSBA2', + 'ISM3PLANARSBA3', 'ISM4PLANARSBA1', 'ISM4PLANARSBA2', 'ISM4PLANARSBA3' ] + ) + if not isosba: + frame_alignment = "error" if frame_alignment == "padding": # Create new input directory for padded files -- GitLab From f7cdbb3ccf970d0a871fc76b3bc2df273c43926e Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 24 Jul 2025 11:10:19 +0200 Subject: [PATCH 3/5] fix formatting --- ivas_processing_scripts/processing/chains.py | 34 ++++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index 60f0e37d..ed8ca3bc 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -575,15 +575,35 @@ def validate_input_files(cfg: TestConfig): # always throw an error for ISM (and MASA) input if input_format.startswith("ISM") or input_format.startswith("MASA"): isosb = False - isosba = (input_format in ['ISM1SBA1', 'ISM1SBA2', 'ISM1SBA3', 'ISM2SBA1', 'ISM2SBA2', 'ISM2SBA3', - 'ISM3SBA1', 'ISM3SBA2', 'ISM3SBA3', 'ISM4SBA1', 'ISM4SBA2', 'ISM4SBA3', - 'ISM1PLANARSBA1', 'ISM1PLANARSBA2', 'ISM1PLANARSBA3', 'ISM2PLANARSBA1', - 'ISM2PLANARSBA2', 'ISM2PLANARSBA3', 'ISM3PLANARSBA1', 'ISM3PLANARSBA2', - 'ISM3PLANARSBA3', 'ISM4PLANARSBA1', 'ISM4PLANARSBA2', 'ISM4PLANARSBA3' ] - ) + isosba = input_format in [ + "ISM1SBA1", + "ISM1SBA2", + "ISM1SBA3", + "ISM2SBA1", + "ISM2SBA2", + "ISM2SBA3", + "ISM3SBA1", + "ISM3SBA2", + "ISM3SBA3", + "ISM4SBA1", + "ISM4SBA2", + "ISM4SBA3", + "ISM1PLANARSBA1", + "ISM1PLANARSBA2", + "ISM1PLANARSBA3", + "ISM2PLANARSBA1", + "ISM2PLANARSBA2", + "ISM2PLANARSBA3", + "ISM3PLANARSBA1", + "ISM3PLANARSBA2", + "ISM3PLANARSBA3", + "ISM4PLANARSBA1", + "ISM4PLANARSBA2", + "ISM4PLANARSBA3", + ] if not isosba: frame_alignment = "error" - + if frame_alignment == "padding": # Create new input directory for padded files aligned_output_dir = cfg.output_path / "20ms_aligned_files" -- GitLab From d6b5e9116263a22f1c2dc4a5be5715edb2801da2 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Thu, 24 Jul 2025 11:11:44 +0200 Subject: [PATCH 4/5] fix lint error --- ivas_processing_scripts/processing/chains.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index ed8ca3bc..be94e7c0 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -574,7 +574,6 @@ def validate_input_files(cfg: TestConfig): # always throw an error for ISM (and MASA) input if input_format.startswith("ISM") or input_format.startswith("MASA"): - isosb = False isosba = input_format in [ "ISM1SBA1", "ISM1SBA2", -- GitLab From bc8c4ee9506a1f352025e64a89b9ada80f76974e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 25 Jul 2025 10:40:00 +0200 Subject: [PATCH 5/5] add comment about disabling error for padding ISM/MASA based inputs --- ivas_processing_scripts/processing/chains.py | 34 +++----------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index be94e7c0..6ee222dc 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -574,34 +574,10 @@ def validate_input_files(cfg: TestConfig): # always throw an error for ISM (and MASA) input if input_format.startswith("ISM") or input_format.startswith("MASA"): - isosba = input_format in [ - "ISM1SBA1", - "ISM1SBA2", - "ISM1SBA3", - "ISM2SBA1", - "ISM2SBA2", - "ISM2SBA3", - "ISM3SBA1", - "ISM3SBA2", - "ISM3SBA3", - "ISM4SBA1", - "ISM4SBA2", - "ISM4SBA3", - "ISM1PLANARSBA1", - "ISM1PLANARSBA2", - "ISM1PLANARSBA3", - "ISM2PLANARSBA1", - "ISM2PLANARSBA2", - "ISM2PLANARSBA3", - "ISM3PLANARSBA1", - "ISM3PLANARSBA2", - "ISM3PLANARSBA3", - "ISM4PLANARSBA1", - "ISM4PLANARSBA2", - "ISM4PLANARSBA3", - ] - if not isosba: - frame_alignment = "error" + frame_alignment = "error" + # NOTE: to override this warning for local testing, simply uncomment the below line + # this will override the above variable and enable padding for non-aligned files + # frame_alignment = "padding" if frame_alignment == "padding": # Create new input directory for padded files @@ -678,8 +654,6 @@ def validate_input_files(cfg: TestConfig): copyfile(item, aligned_output_dir / item.name) # Update audio file path in list cfg.items_list[i] = aligned_output_dir / item.name - else: - pass if frame_alignment == "padding": # copy over any metadata files -- GitLab