Commit 8e03ba51 authored by Anika Treffehn's avatar Anika Treffehn
Browse files

formatting

parent fa793acf
Loading
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -179,9 +179,13 @@ def concat_teardown(x, splits, out_fmt, fs, in_fs, meta, logger: logging.Logger)

    # check if last split ending coincides with last sample of signal
    if splits[-1] > len(x):
        raise ValueError(f"Last split index {splits[-1]} is larger than the signal length {len(x)}")
        raise ValueError(
            f"Last split index {splits[-1]} is larger than the signal length {len(x)}"
        )
    elif splits[-1] < len(x):
        warn(f"Last split index {splits[-1]} is smaller that the signal length {len(x)}")
        warn(
            f"Last split index {splits[-1]} is smaller that the signal length {len(x)}"
        )

    split_old = 0
    split_signals = []
@@ -477,7 +481,9 @@ def multiple_of_frame_size(
    try:
        output_dir.mkdir(exist_ok=False)
    except FileExistsError:
        raise ValueError("Folder for 20ms aligned files already exists. Please move or delete folder")
        raise ValueError(
            "Folder for 20ms aligned files already exists. Please move or delete folder"
        )

    # iterate over input files
    for i, item in enumerate(cfg.items_list):
+8 −2
Original line number Diff line number Diff line
@@ -241,10 +241,16 @@ class Processing_splitting_scaling(Processing):

        else:
            # check length of output signals
            input_aligned_file = in_file.parent.parent / "20ms_aligned_files" / f"{Path(in_file.stem).stem}.wav"
            input_aligned_file = (
                in_file.parent.parent
                / "20ms_aligned_files"
                / f"{Path(in_file.stem).stem}.wav"
            )
            input_aligned_array, _ = read(input_aligned_file)
            if (len_inp := len(input_aligned_array)) != (len_out := len(x)):
                warn(f"For file {out_file} the length is {len_out} and does not match the (frame aligned) input length {len_inp}.")
                warn(
                    f"For file {out_file} the length is {len_out} and does not match the (frame aligned) input length {len_inp}."
                )

            # set output values
            out_files = [out_file]