Commit 19fe6270 authored by Jan Kiene's avatar Jan Kiene
Browse files

add explicit fail if no split indices found

parent 244927ac
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1278,7 +1278,14 @@ def get_split_idx(input_file: str, sampling_rate_khz: int) -> Optional[np.ndarra
            format = "osba_hoa"
    else:
        format = input_file.split("_")[-1].lower()
    idx = SPLIT_IDX.get(format, np.empty(0)).copy()
    idx = SPLIT_IDX.get(format)

    if idx is None:
        pytest.fail(
            f"Could not get split indices for file {input_file} with infered format {format}."
        )

    idx = idx.copy()

    if len(idx) > 0 and sampling_rate_khz != 16:
        idx *= sampling_rate_khz // 16