Loading tests/hrtf_binary_loading/constants.py +5 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,11 @@ HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin" HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin" HRTF_FILES = [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM] HRTF_TAG_SAME_AS_ROM = "hrtf_same_as_rom" HRTF_TAG_DIFF_FROM_ROM = "hrtf_diff_from_rom" HRTF_TAGS = [HRTF_TAG_SAME_AS_ROM, HRTF_TAG_DIFF_FROM_ROM] HRTF_FILE_FOR_TAG = dict(zip(HRTF_TAGS, HRTF_FILES)) SAMPLE_RATE = ["16", "32", "48"] INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] # "MONO", "STEREO", Loading tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +46 −46 Original line number Diff line number Diff line Loading @@ -34,32 +34,32 @@ import itertools from tests.hrtf_binary_loading.utils import * from .constants import HRTF_FILES, HRTF_BINARY_FILE_DIFF_FROM_ROM from .constants import HRTF_TAGS """ Binary file """ @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_binary_file(test_info, hrtf_file, out_fs): check_binary_file(hrtf_file, out_fs) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_binary_file(test_info, hrtf_tag, out_fs): check_binary_file(hrtf_tag, out_fs) """ Multichannel """ @pytest.mark.parametrize( ("out_fmt", "out_fs", "in_fmt", "hrtf_file"), ("out_fmt", "out_fs", "in_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_FILES OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_TAGS ) ], ) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_file): def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag): bitrate = 512000 in_fs = 48 option_list = ["-mc", in_fmt] Loading @@ -73,12 +73,12 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_file"), ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -88,12 +88,12 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_FILES, HRTF_TAGS, ) ], ) def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_file test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag ): bitrate = 512000 in_fs = 48 Loading @@ -108,7 +108,7 @@ def test_multichannel_binaural_headrotation( in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -117,17 +117,17 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize( ("in_fmt", "fs", "out_fmt", "hrtf_file"), ("in_fmt", "fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_FILES INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_TAGS ) ], ) def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_tag): bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) Loading @@ -140,12 +140,12 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): fs, out_fmt, fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_file"), ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -155,11 +155,11 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], [HR_TRAJECTORIES_TO_TEST[0]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_file): def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_tag): bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) Loading @@ -172,7 +172,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt fs, out_fmt, fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -181,7 +181,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt @pytest.mark.parametrize( ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_file"), ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -191,13 +191,13 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt SAMPLE_RATE[-1:], INPUT_FORMATS_MASA["dir"], INPUT_FORMATS_MASA["tc"], HRTF_FILES, HRTF_TAGS, ) ], ) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( Loading @@ -214,12 +214,12 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): fs, out_fmt, fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_file"), ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -230,15 +230,15 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE[-1:], [HR_TRAJECTORIES_TO_TEST[1]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_tag ): # TODO: remove once fixed if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( Loading @@ -255,7 +255,7 @@ def test_masa_binaural_headrotation( fs, out_fmt, fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -264,17 +264,17 @@ def test_masa_binaural_headrotation( @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_FILES INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_TAGS ) ], ) def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] Loading @@ -295,12 +295,12 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -310,12 +310,12 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], [HR_TRAJECTORIES_TO_TEST[0]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_ism_binaural_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] Loading @@ -337,7 +337,7 @@ def test_ism_binaural_headrotation( in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -346,17 +346,17 @@ def test_ism_binaural_headrotation( @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_FILES INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_TAGS ) ], ) def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] Loading @@ -377,12 +377,12 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -392,12 +392,12 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], [HR_TRAJECTORIES_TO_TEST[0]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_ism_binaural_roomreverb_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] Loading @@ -419,6 +419,6 @@ def test_ism_binaural_roomreverb_headrotation( in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +31 −31 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ from tests.renderer.constants import ( INPUT_FORMATS_MC, ) from .constants import HRTF_FILES from .constants import HRTF_TAGS """ Ambisonics """ Loading @@ -51,12 +51,12 @@ from .constants import HRTF_FILES @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ambisonics_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size test_info, in_fmt, out_fmt, hrtf_tag, frame_size=frame_size ) Loading @@ -64,15 +64,15 @@ def test_ambisonics_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ambisonics_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) Loading @@ -84,15 +84,15 @@ def test_ambisonics_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size test_info, in_fmt, out_fmt, hrtf_tag, frame_size=frame_size ) Loading @@ -100,9 +100,9 @@ def test_multichannel_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") Loading @@ -111,7 +111,7 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) Loading @@ -123,9 +123,9 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] Loading @@ -136,7 +136,7 @@ def test_ism_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, in_meta_files=in_meta_files, frame_size=frame_size, ) Loading @@ -146,9 +146,9 @@ def test_ism_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] Loading @@ -159,7 +159,7 @@ def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, frame_size=frame_size, Loading @@ -172,9 +172,9 @@ def test_ism_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") Loading @@ -183,7 +183,7 @@ def test_masa_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) Loading @@ -192,9 +192,9 @@ def test_masa_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") Loading @@ -203,7 +203,7 @@ def test_masa_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) Loading @@ -215,15 +215,15 @@ def test_masa_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_custom_ls_input_binaural_with_binary_hrir( test_info, in_layout, out_fmt, frame_size, hrtf_file test_info, in_layout, out_fmt, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, hrtf_file, hrtf_tag, frame_size=frame_size, ) Loading @@ -232,15 +232,15 @@ def test_custom_ls_input_binaural_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_custom_ls_input_binaural_headrotation_with_binary_hrir( test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_file test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) tests/hrtf_binary_loading/utils.py +7 −3 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ def get_option_list_str(option_list): return option_list_str def check_binary_file(hrtf_file, out_fs): def check_binary_file(hrtf_tag, out_fs): hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] with open(str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb") as file: binary_data = file.read() Loading Loading @@ -284,13 +285,15 @@ def compare_rom_vs_binary( in_fs, out_fmt, out_fs, hrtf_file: str, hrtf_tag: str, keep_file: Optional[bool] = False, trj_file: Optional[str] = None, ): option_str = "_".join(get_option_list_str(option_list_enc)) file_ext = f"_{option_str or ''}_{bitrate or ''}_{in_fs or ''}-{out_fs or ''}_{out_fmt or ''}-{uuid.uuid1()} " hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM input_path = TESTV_DIR.joinpath(in_file).with_suffix(".wav") Loading Loading @@ -333,7 +336,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, metadata_input: Optional[str] = None, in_meta_files: Optional[list] = None, trj_file: Optional[str] = None, Loading @@ -346,6 +349,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( frame_size: Optional[str] = "20ms", keep_file=False, ): hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM hrtf_file_dir = SCRIPTS_DIR.joinpath( Loading Loading
tests/hrtf_binary_loading/constants.py +5 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,11 @@ HRTF_BINARY_FILE_SAME_AS_ROM = "ivas_binaural_{}kHz.bin" HRTF_BINARY_FILE_DIFF_FROM_ROM = "ivas_binaural_51_brir-lc_{}kHz.bin" HRTF_FILES = [HRTF_BINARY_FILE_SAME_AS_ROM, HRTF_BINARY_FILE_DIFF_FROM_ROM] HRTF_TAG_SAME_AS_ROM = "hrtf_same_as_rom" HRTF_TAG_DIFF_FROM_ROM = "hrtf_diff_from_rom" HRTF_TAGS = [HRTF_TAG_SAME_AS_ROM, HRTF_TAG_DIFF_FROM_ROM] HRTF_FILE_FOR_TAG = dict(zip(HRTF_TAGS, HRTF_FILES)) SAMPLE_RATE = ["16", "32", "48"] INPUT_FORMATS_MC = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] # "MONO", "STEREO", Loading
tests/hrtf_binary_loading/test_codec_ROM_vs_file.py +46 −46 Original line number Diff line number Diff line Loading @@ -34,32 +34,32 @@ import itertools from tests.hrtf_binary_loading.utils import * from .constants import HRTF_FILES, HRTF_BINARY_FILE_DIFF_FROM_ROM from .constants import HRTF_TAGS """ Binary file """ @pytest.mark.parametrize("out_fs", SAMPLE_RATE) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) def test_binary_file(test_info, hrtf_file, out_fs): check_binary_file(hrtf_file, out_fs) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_binary_file(test_info, hrtf_tag, out_fs): check_binary_file(hrtf_tag, out_fs) """ Multichannel """ @pytest.mark.parametrize( ("out_fmt", "out_fs", "in_fmt", "hrtf_file"), ("out_fmt", "out_fs", "in_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_FILES OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_TAGS ) ], ) def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_file): def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_tag): bitrate = 512000 in_fs = 48 option_list = ["-mc", in_fmt] Loading @@ -73,12 +73,12 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_file"), ("trj_file", "out_fmt", "out_fs", "in_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -88,12 +88,12 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, out_fs, hrtf_f OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE, INPUT_FORMATS_MC, HRTF_FILES, HRTF_TAGS, ) ], ) def test_multichannel_binaural_headrotation( test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_file test_info, in_fmt, out_fmt, out_fs, trj_file, hrtf_tag ): bitrate = 512000 in_fs = 48 Loading @@ -108,7 +108,7 @@ def test_multichannel_binaural_headrotation( in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -117,17 +117,17 @@ def test_multichannel_binaural_headrotation( @pytest.mark.parametrize( ("in_fmt", "fs", "out_fmt", "hrtf_file"), ("in_fmt", "fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_FILES INPUT_FORMATS_SBA, SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], HRTF_TAGS ) ], ) def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_tag): bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) Loading @@ -140,12 +140,12 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): fs, out_fmt, fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_file"), ("in_fmt", "fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -155,11 +155,11 @@ def test_sba_binaural_static(test_info, in_fmt, fs, out_fmt, hrtf_file): SAMPLE_RATE[1:], OUTPUT_FORMATS_BINAURAL[:-1], [HR_TRAJECTORIES_TO_TEST[0]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_file): def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrtf_tag): bitrate = 256000 option_list = ["-sba", in_fmt] in_file = FORMAT_TO_FILE_SBA_WOEXT[in_fmt].format(fs) Loading @@ -172,7 +172,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt fs, out_fmt, fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -181,7 +181,7 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt @pytest.mark.parametrize( ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_file"), ("out_fmt", "fs", "in_dir", "in_tc", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -191,13 +191,13 @@ def test_sba_binaural_headrotation(test_info, in_fmt, fs, out_fmt, trj_file, hrt SAMPLE_RATE[-1:], INPUT_FORMATS_MASA["dir"], INPUT_FORMATS_MASA["tc"], HRTF_FILES, HRTF_TAGS, ) ], ) def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_tag): # TODO: remove once fixed if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( Loading @@ -214,12 +214,12 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): fs, out_fmt, fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_file"), ("in_tc", "in_dir", "out_fmt", "fs", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -230,15 +230,15 @@ def test_masa_binaural_static(test_info, in_tc, in_dir, fs, out_fmt, hrtf_file): OUTPUT_FORMATS_BINAURAL[:-1], SAMPLE_RATE[-1:], [HR_TRAJECTORIES_TO_TEST[1]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_masa_binaural_headrotation( test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_file test_info, in_tc, in_dir, fs, out_fmt, trj_file, hrtf_tag ): # TODO: remove once fixed if hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM: if hrtf_tag == HRTF_BINARY_FILE_DIFF_FROM_ROM: pytest.skip("Skipped due to bug in paramBin HRTF loading") bitrate = 256000 metadata_file = str( Loading @@ -255,7 +255,7 @@ def test_masa_binaural_headrotation( fs, out_fmt, fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -264,17 +264,17 @@ def test_masa_binaural_headrotation( @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_FILES INPUT_FORMATS_ISM, SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], HRTF_TAGS ) ], ) def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] Loading @@ -295,12 +295,12 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -310,12 +310,12 @@ def test_ism_binaural_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): SAMPLE_RATE, [OUTPUT_FORMATS_BINAURAL[0]], [HR_TRAJECTORIES_TO_TEST[0]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_ism_binaural_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] Loading @@ -337,7 +337,7 @@ def test_ism_binaural_headrotation( in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), ) Loading @@ -346,17 +346,17 @@ def test_ism_binaural_headrotation( @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM else x for x in itertools.product( INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_FILES INPUT_FORMATS_ISM, SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], HRTF_TAGS ) ], ) def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_file): def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf_tag): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] option_list = ["-ism", in_fmt] Loading @@ -377,12 +377,12 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, ) @pytest.mark.parametrize( ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_file"), ("in_fmt", "out_fs", "out_fmt", "trj_file", "hrtf_tag"), [ pytest.param(*x, marks=pytest.mark.xfail(strict=True)) if x[-1] == HRTF_BINARY_FILE_DIFF_FROM_ROM Loading @@ -392,12 +392,12 @@ def test_ism_binaural_roomreverb_static(test_info, in_fmt, out_fs, out_fmt, hrtf SAMPLE_RATE, OUTPUT_FORMATS_BINAURAL[-1:], [HR_TRAJECTORIES_TO_TEST[0]], HRTF_FILES, HRTF_TAGS, ) ], ) def test_ism_binaural_roomreverb_headrotation( test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_file test_info, in_fmt, out_fs, out_fmt, trj_file, hrtf_tag ): in_fs = 48 bitrate = BITRATE_ISM[in_fmt] Loading @@ -419,6 +419,6 @@ def test_ism_binaural_roomreverb_headrotation( in_fs, out_fmt, out_fs, hrtf_file, hrtf_tag, trj_file=str(TESTV_DIR.joinpath(f"{trj_file}.csv")), )
tests/hrtf_binary_loading/test_renderer_ROM_vs_file.py +31 −31 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ from tests.renderer.constants import ( INPUT_FORMATS_MC, ) from .constants import HRTF_FILES from .constants import HRTF_TAGS """ Ambisonics """ Loading @@ -51,12 +51,12 @@ from .constants import HRTF_FILES @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ambisonics_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size test_info, in_fmt, out_fmt, hrtf_tag, frame_size=frame_size ) Loading @@ -64,15 +64,15 @@ def test_ambisonics_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ambisonics_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) Loading @@ -84,15 +84,15 @@ def test_ambisonics_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, frame_size=frame_size test_info, in_fmt, out_fmt, hrtf_tag, frame_size=frame_size ) Loading @@ -100,9 +100,9 @@ def test_multichannel_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_multichannel_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") Loading @@ -111,7 +111,7 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, ) Loading @@ -123,9 +123,9 @@ def test_multichannel_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] Loading @@ -136,7 +136,7 @@ def test_ism_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, in_meta_files=in_meta_files, frame_size=frame_size, ) Loading @@ -146,9 +146,9 @@ def test_ism_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): try: in_meta_files = FORMAT_TO_METADATA_FILES_RENDERER[in_fmt] Loading @@ -159,7 +159,7 @@ def test_ism_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=in_meta_files, frame_size=frame_size, Loading @@ -172,9 +172,9 @@ def test_ism_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, frame_size, hrtf_file test_info, in_fmt, out_fmt, frame_size, hrtf_tag ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") Loading @@ -183,7 +183,7 @@ def test_masa_binaural_static_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) Loading @@ -192,9 +192,9 @@ def test_masa_binaural_static_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA_RENDERER) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_masa_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_file test_info, in_fmt, out_fmt, trj_file, frame_size, hrtf_tag ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") Loading @@ -203,7 +203,7 @@ def test_masa_binaural_headrotation_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), in_meta_files=FORMAT_TO_METADATA_FILES_RENDERER[in_fmt], ) Loading @@ -215,15 +215,15 @@ def test_masa_binaural_headrotation_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_custom_ls_input_binaural_with_binary_hrir( test_info, in_layout, out_fmt, frame_size, hrtf_file test_info, in_layout, out_fmt, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, hrtf_file, hrtf_tag, frame_size=frame_size, ) Loading @@ -232,15 +232,15 @@ def test_custom_ls_input_binaural_with_binary_hrir( @pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL) @pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST) @pytest.mark.parametrize("frame_size", FRAMING_TO_TEST) @pytest.mark.parametrize("hrtf_file", HRTF_FILES) @pytest.mark.parametrize("hrtf_tag", HRTF_TAGS) def test_custom_ls_input_binaural_headrotation_with_binary_hrir( test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_file test_info, in_layout, out_fmt, trj_file, frame_size, hrtf_tag ): compare_renderer_vs_renderer_with_binary_hrir( test_info, CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"), out_fmt, hrtf_file, hrtf_tag, trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"), frame_size=frame_size, )
tests/hrtf_binary_loading/utils.py +7 −3 Original line number Diff line number Diff line Loading @@ -140,7 +140,8 @@ def get_option_list_str(option_list): return option_list_str def check_binary_file(hrtf_file, out_fs): def check_binary_file(hrtf_tag, out_fs): hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] with open(str(HRTF_BINARY_DIR.joinpath(hrtf_file.format(out_fs))), "rb") as file: binary_data = file.read() Loading Loading @@ -284,13 +285,15 @@ def compare_rom_vs_binary( in_fs, out_fmt, out_fs, hrtf_file: str, hrtf_tag: str, keep_file: Optional[bool] = False, trj_file: Optional[str] = None, ): option_str = "_".join(get_option_list_str(option_list_enc)) file_ext = f"_{option_str or ''}_{bitrate or ''}_{in_fs or ''}-{out_fs or ''}_{out_fmt or ''}-{uuid.uuid1()} " hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM input_path = TESTV_DIR.joinpath(in_file).with_suffix(".wav") Loading Loading @@ -333,7 +336,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( test_info, in_fmt, out_fmt, hrtf_file, hrtf_tag, metadata_input: Optional[str] = None, in_meta_files: Optional[list] = None, trj_file: Optional[str] = None, Loading @@ -346,6 +349,7 @@ def compare_renderer_vs_renderer_with_binary_hrir( frame_size: Optional[str] = "20ms", keep_file=False, ): hrtf_file = HRTF_FILE_FOR_TAG[hrtf_tag] xfail = hrtf_file == HRTF_BINARY_FILE_DIFF_FROM_ROM hrtf_file_dir = SCRIPTS_DIR.joinpath( Loading