Commit d906eb1a authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

rename file constants to be clearer about where they are used

parent f586732a
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ NCHAN_TO_FILE = {
    16: TEST_VECTOR_DIR.joinpath("spectral_test_16ch_48kHz.wav"),
}

FORMAT_TO_FILE_STV = {
FORMAT_TO_FILE_SMOKETEST = {
    "MONO": NCHAN_TO_FILE[1],
    "STEREO": NCHAN_TO_FILE[2],
    "5_1": NCHAN_TO_FILE[6],
@@ -108,7 +108,7 @@ FORMAT_TO_FILE_STV = {
    "t_design_4": NCHAN_TO_FILE[12],
}

FORMAT_TO_FILE_LTV = {
FORMAT_TO_FILE_COMPARETEST = {
    "MONO": TESTV_DIR.joinpath("test_mono.wav"),
    "STEREO": TESTV_DIR.joinpath("test_stereo.wav"),
    "5_1": TESTV_DIR.joinpath("test_MC51.wav"),
+14 −14
Original line number Diff line number Diff line
@@ -37,13 +37,13 @@ from .utils import *
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@@ -55,7 +55,7 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        use_ltv=True,
        is_comparetest=True,
    )


@@ -65,7 +65,7 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC)
def test_multichannel(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@@ -74,7 +74,7 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, use_ltv=True)
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@@ -89,7 +89,7 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file
        in_fmt,
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        use_ltv=True,
        is_comparetest=True,
    )


@@ -113,7 +113,7 @@ def test_ism_binaural_static(test_info, in_fmt, out_fmt):
        in_meta_files = None

    compare_renderer_vs_mergetarget(
        test_info, in_fmt, out_fmt, in_meta_files=in_meta_files, use_ltv=True
        test_info, in_fmt, out_fmt, in_meta_files=in_meta_files, is_comparetest=True
    )


@@ -132,7 +132,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        in_meta_files=in_meta_files,
        use_ltv=True,
        is_comparetest=True,
    )


@@ -146,7 +146,7 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST)
def test_custom_ls_input(test_info, in_layout, out_fmt):
    compare_renderer_vs_mergetarget(
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, use_ltv=True
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, is_comparetest=True
    )


@@ -154,7 +154,7 @@ def test_custom_ls_input(test_info, in_layout, out_fmt):
@pytest.mark.parametrize("in_fmt", OUTPUT_FORMATS)
def test_custom_ls_output(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(
        test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), use_ltv=True
        test_info, in_fmt, CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"), is_comparetest=True
    )


@@ -165,7 +165,7 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt):
        test_info,
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_fmt}.txt"),
        CUSTOM_LAYOUT_DIR.joinpath(f"{out_fmt}.txt"),
        use_ltv=True,
        is_comparetest=True,
    )


@@ -173,7 +173,7 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt):
@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST)
def test_custom_ls_input_binaural(test_info, in_layout, out_fmt):
    compare_renderer_vs_mergetarget(
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, use_ltv=True
        test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, is_comparetest=True
    )


@@ -186,7 +186,7 @@ def test_custom_ls_input_binaural_headrotation(test_info, in_layout, out_fmt, tr
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
        out_fmt,
        trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        use_ltv=True,
        is_comparetest=True,
    )


@@ -201,5 +201,5 @@ def test_metadata(test_info, in_fmt, out_fmt):
        "META",
        out_fmt,
        metadata_input=TEST_VECTOR_DIR.joinpath(f"{in_fmt}.txt"),
        use_ltv=True,
        is_comparetest=True,
    )
+8 −8
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ def run_renderer(
    trj_file: Optional[str] = None,
    output_path_base: str = OUTPUT_PATH_CUT,
    binary_suffix: str = "",
    use_ltv: Optional[bool] = False,
    is_comparetest: Optional[bool] = False,
) -> Tuple[np.ndarray, int]:
    """CuT creation with standalone renderer"""
    if trj_file is not None:
@@ -121,10 +121,10 @@ def run_renderer(
    else:
        out_name = out_fmt

    if use_ltv:
        FORMAT_TO_FILE = FORMAT_TO_FILE_LTV
    if is_comparetest:
        FORMAT_TO_FILE = FORMAT_TO_FILE_COMPARETEST
    else:
        FORMAT_TO_FILE = FORMAT_TO_FILE_STV
        FORMAT_TO_FILE = FORMAT_TO_FILE_SMOKETEST

    if metadata_input is not None:
        in_file = metadata_input
@@ -163,7 +163,7 @@ def run_pyscripts(
    metadata_input: Optional[str] = None,
    in_meta_files: Optional[list] = None,
    trj_file: Optional[str] = None,
    use_ltv: Optional[bool] = False,
    is_comparetest: Optional[bool] = False,
) -> Tuple[np.ndarray, int]:
    """Reference creation with pyaudio3dtools"""
    if trj_file is not None:
@@ -176,10 +176,10 @@ def run_pyscripts(
    else:
        out_name = out_fmt

    if use_ltv:
        FORMAT_TO_FILE = FORMAT_TO_FILE_LTV
    if is_comparetest:
        FORMAT_TO_FILE = FORMAT_TO_FILE_COMPARETEST
    else:
        FORMAT_TO_FILE = FORMAT_TO_FILE_STV
        FORMAT_TO_FILE = FORMAT_TO_FILE_SMOKETEST

    if metadata_input is not None:
        in_file = metadata_input