Commit 4bb5e4ac authored by stoutjesdijk's avatar stoutjesdijk 🎧
Browse files

add test for render config file

parent bf7f2070
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -193,6 +193,10 @@ HR_TRAJECTORIES_TO_TEST = [
    "rotate_yaw_pitch_roll1",
]

CONFIG_FILES_TO_TEST = [
    "just_reverb"
]

""" Per-testcase xfail SNR thresholds (dB) """
pass_snr = dict()  # not relevant for tests anymore, should be deprecated soon
_pass_snr = {
+18 −0
Original line number Diff line number Diff line
@@ -56,6 +56,24 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
    )


# Test compares rendering with render config file containing just reverb defaults against rendering without config file.
# These should be binary equivalent.
@pytest.mark.parametrize("config_file", CONFIG_FILES_TO_TEST)
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ambisonics_binaural_headrotation_defaultrenderconfig(test_info, in_fmt, out_fmt, config_file):
    compare_renderer_args(
        test_info,
        in_fmt,
        out_fmt,
        ref_kwargs={
            "name_extension": "defaultrenderconfig"
        },
        cut_kwargs={
            "config_file": TESTV_DIR.joinpath(f"{config_file}.cfg")
        }
    )

# Test compares rendering with just a trajectory file against rendering with a trajectory file + a zero ref rotation.
# These should be binary equivalent.
@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
+9 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ def run_renderer(
    refrot_file: Optional[str] = None,
    refvec_file: Optional[str] = None,
    refveclev_file: Optional[str] = None,
    config_file: Optional[str] = None,
    output_path_base: str = OUTPUT_PATH_CUT,
    binary_suffix: str = "",
    is_comparetest: Optional[bool] = False,
@@ -134,6 +135,11 @@ def run_renderer(
    else:
        refveclev_name = ""

    if config_file is not None:
        config_name = f"_{config_file.stem}"
    else:
        refveclev_name = ""



    if not isinstance(out_fmt, str):
@@ -184,6 +190,9 @@ def run_renderer(
        cmd.extend(["-rvf", str(refveclev_file)])
        cmd.extend(["-otr", "ref_vec_lev"])

    if config_file is not None:
        cmd.extend(["-rc", str(config_file)])

    run_cmd(cmd)

    return pyaudio3dtools.audiofile.readfile(out_file)