Commit b6018aeb authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

add debugging for OSBA issue

parent aae20d20
Loading
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -240,6 +240,9 @@ def main(args):
    input_audio_cache = {}
    tasks = []

    print(f"Collecting inputs and measuring reference loudness for {cfg_formats}:")
    completed = 0
    progressbar_update(completed, len(cfg_formats), width=50)
    # we need to loop over both format names so we can get a proper regex
    for cfg_fmt, proc_fmt in zip(cfg_formats, proc_formats):
        infile = FORMAT_2_FILE[proc_fmt]
@@ -272,7 +275,11 @@ def main(args):
                input_audio = fromfile(
                    proc_fmt, resampled_file, fs=int(fs) * 1000, in_meta=metadata
                )
                try:
                    input_loudness, _, input_loudness_format = get_loudness(input_audio)
                except ValueError:
                    print(f"Error measuring input loudness for {resampled_file}")
                    continue
                input_audio_cache[cache_key] = (input_loudness, input_loudness_format)

        # Find all output files for this format
@@ -309,9 +316,11 @@ def main(args):
                    pattern,
                )
            )
        completed += 1
        progressbar_update(completed, len(cfg_formats), width=50)

    print(
        f"Found {len(tasks)} files to process across {len(valid_formats)} format(s)\n"
        f"\nFound {len(tasks)} files to process across {len(valid_formats)} format(s)\n"
    )
    if not len(tasks):
        print("Nothing to do, exiting...")