Commit b5dd1acd authored by Jan Kiene's avatar Jan Kiene
Browse files

handle missing sampling rate with silence_pre/post != 0

parent 63bf5655
Loading
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -164,6 +164,14 @@ def concat_setup(cfg: TestConfig, chain, logger: logging.Logger):
    tmp_num_chans = tmp_audio.num_channels

    # convert from milisecs to samples
    silence_pre = 0
    silence_post = 0
    if (cfg_pre2.silence_pre != 0 or silence_post != 0)
        if cfg_pre2.in_fs is None:
            raise ValueError(
                "silence_pre and silence_post can only be non-zero if you provide the sampling rate in the input section!"
            )

        silence_pre = int(cfg_pre2.silence_pre / 1000 * cfg_pre2.in_fs)
        silence_post = int(cfg_pre2.silence_post / 1000 * cfg_pre2.in_fs)