Commit 5bf37d91 authored by Jan Kiene's avatar Jan Kiene
Browse files

use format as key for split indices

parent 024f2a72
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1262,7 +1262,8 @@ def get_split_idx(input_file: str, sampling_rate_khz: int) -> Optional[np.ndarra

    If no list of indices is available for the given input file, an empty array is returned.
    """
    idx = SPLIT_IDX.get(input_file.lower(), np.empty(0))
    format = input_file.replace(".wav", "").split("_")[-1].lower()
    idx = SPLIT_IDX.get(format, np.empty(0))

    if len(idx) > 0 and sampling_rate_khz != 16:
        idx *= sampling_rate_khz // 16
+1 −1
Original line number Diff line number Diff line
@@ -101,4 +101,4 @@ SPLIT_IDX_LTV_STEREO_16KHZ = np.asarray(
    ]
)

SPLIT_IDX = {"ltv16_stereo": SPLIT_IDX_LTV_STEREO_16KHZ}
SPLIT_IDX = {"stereo": SPLIT_IDX_LTV_STEREO_16KHZ}