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

handle dual-mono EVS for stereo MASA input cases

parent 7bdb0f4d
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -290,6 +290,21 @@ def get_processing_chain(
        else:
            preamble = 0

        # if the encoding format differs from the format after the preprocessing, add format conversion stuff
        if tmp_in_fmt != cod_cfg["fmt"]:
            chain["processes"].append(
                Preprocessing(
                    {
                        "in_fs": tmp_in_fs,
                        "in_fmt": tmp_in_fmt,
                        "out_fs": tmp_in_fs,
                        "out_fmt": cod_cfg["fmt"],
                        "multiprocessing": cfg.multiprocessing,
                    }
                )
            )
            tmp_in_fmt = cod_cfg["fmt"]

        chain["processes"].append(
            EVS(
                {
@@ -311,7 +326,7 @@ def get_processing_chain(
        )
        # update values to reflect decoder output
        tmp_in_fs = dec_cfg.get("fs", tmp_in_fs)
        tmp_in_fmt = cond_cfg.get("sba_format", cfg.input["fmt"])
        tmp_in_fmt = cond_cfg.get("sba_format", tmp_in_fmt)

    elif cond_cfg["type"] == "ivas":
        cod_cfg = cond_cfg["cod"]
+5 −0
Original line number Diff line number Diff line
@@ -245,6 +245,11 @@ class EVS(Processing):
                        / f"{out_file.stem.split('.')[0]}.evs{out_file.suffix}.{idx}.csv"
                    )
                    copyfile(in_meta[idx], out_file_meta)
            # copy MASA metadata for MASA pass-through
            if isinstance(condition_fmt, audio.MetadataAssistedSpatialAudio):
                md_file_in = in_file.parent / (in_file.name + ".met")
                md_file_out = out_file.parent / (out_file.name + ".met")
                copyfile(md_file_in, md_file_out)
        elif out_file.suffix == ".txt":
            raise NotImplementedError(".txt file support is WIP")
            # output_wav = out_file.replace(output_ext, ".wav")