From 00fc1e6df67b9ad5773ed7940e475ad39b08ebc9 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Tue, 11 Apr 2023 16:25:26 +0200 Subject: [PATCH] added dolby HRIR SBA datasets and added gitignore --- .gitignore | 13 +++++++++++++ README.md | 2 +- examples/TEMPLATE.yml | 2 +- .../HRIR_ORANGE53_Dolby_SBA1.mat | 3 +++ .../HRIR_ORANGE53_Dolby_SBA2.mat | 3 +++ .../HRIR_ORANGE53_Dolby_SBA3.mat | 3 +++ .../binaural_datasets/binaural_dataset.py | 19 ++++++++++++++++--- .../audiotools/convert/masa.py | 2 -- 8 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA1.mat create mode 100644 ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA2.mat create mode 100644 ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA3.mat diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a448a06e --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +__pycache__/ +venv/ +*.py[cod] +*$py.class +.ipynb_checkpoints +.vscode/ +.idea/ +.DS_Store +*.wav +*.pcm +*.bs +*.192 + diff --git a/README.md b/README.md index 524cd1ce..4669de76 100755 --- a/README.md +++ b/README.md @@ -376,7 +376,7 @@ postprocessing: ### default = null (uses postprocessing fmt if possible) # loudness_fmt: null ### Name of custom binaural dataset (without prefix or suffix); - ### default = null (ORANGE53 for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) + ### default = null (ORANGE53_Dolby for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) # bin_dataset: SADIE ### Render LFE to binaural output with the specified gain (only valid for channel-based input); default = null # bin_lfe_gain: 1 diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index 3deae78a..030bd437 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -234,7 +234,7 @@ postprocessing: ### default = null (uses postprocessing fmt if possible) # loudness_fmt: null ### Name of custom binaural dataset (without prefix or suffix); - ### default = null (ORANGE53 for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) + ### default = null (ORANGE53_Dolby for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) # bin_dataset: SADIE ### Render LFE to binaural output with the specified gain (only valid for channel-based input); default = null # bin_lfe_gain: 1 diff --git a/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA1.mat b/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA1.mat new file mode 100644 index 00000000..d30f7571 --- /dev/null +++ b/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA1.mat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49fea9097dd01b0529cdbff150542f4612750ea03cdd75913e2d5bffcf284753 +size 4578 diff --git a/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA2.mat b/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA2.mat new file mode 100644 index 00000000..81450496 --- /dev/null +++ b/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA2.mat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:746b5c4b12010d77bd96cb05534eb2eba6b41381fe50949a2ca3df2c75a940ba +size 10271 diff --git a/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA3.mat b/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA3.mat new file mode 100644 index 00000000..ffa700ca --- /dev/null +++ b/ivas_processing_scripts/audiotools/binaural_datasets/HRIR_ORANGE53_Dolby_SBA3.mat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7704ee5a72a3c051eef04f68f346811b550bde62144a0b71f2aa8fa35a931660 +size 18177 diff --git a/ivas_processing_scripts/audiotools/binaural_datasets/binaural_dataset.py b/ivas_processing_scripts/audiotools/binaural_datasets/binaural_dataset.py index 12ee1018..d944db5b 100755 --- a/ivas_processing_scripts/audiotools/binaural_datasets/binaural_dataset.py +++ b/ivas_processing_scripts/audiotools/binaural_datasets/binaural_dataset.py @@ -129,7 +129,7 @@ def load_ir( elif out_fmt.startswith("BINAURAL"): dataset_prefix = "HRIR" if dataset is None: - dataset = "ORANGE53" + dataset = "ORANGE53_Dolby" if in_fmt in OBJECT_BASED_AUDIO_FORMATS.keys() or in_fmt.startswith( "CUSTOM_LS" @@ -137,8 +137,21 @@ def load_ir( dataset_suffix = "FULL" elif in_fmt in CHANNEL_BASED_AUDIO_FORMATS.keys() and in_fmt != "MONO": dataset_suffix = "LS" - elif in_fmt in SCENE_BASED_AUDIO_FORMATS.keys() or in_fmt == "MONO": - dataset_suffix = "SBA3" + elif in_fmt in SCENE_BASED_AUDIO_FORMATS.keys(): + if in_fmt == "SBA1" or in_fmt == "FOA": + dataset_suffix = "SBA1" + # Use truncated SBA3 dataset if no SBA1 or 2 dataset exists + if not (Path(__file__).parent.joinpath(f"{dataset_prefix}_{dataset}_{dataset_suffix}.mat")).is_file(): + dataset_suffix = "SBA3" + warnings.warn(f"No SBA1 dataset found -> use truncated SBA3 dataset") + elif in_fmt.endswith("2"): + dataset_suffix = "SBA2" + # Use truncated SBA3 dataset if no SBA1 or 2 dataset exists + if not (Path(__file__).parent.joinpath(f"{dataset_prefix}_{dataset}_{dataset_suffix}.mat")).is_file(): + dataset_suffix = "SBA3" + warnings.warn(f"No SBA2 dataset found -> use truncated SBA3 dataset") + else: + dataset_suffix = "SBA3" IR, SourcePosition, latency_s = load_hrtf( Path(__file__).parent.joinpath( diff --git a/ivas_processing_scripts/audiotools/convert/masa.py b/ivas_processing_scripts/audiotools/convert/masa.py index 0014ef80..c03977ab 100755 --- a/ivas_processing_scripts/audiotools/convert/masa.py +++ b/ivas_processing_scripts/audiotools/convert/masa.py @@ -78,8 +78,6 @@ def render_masa_to_binaural( **kwargs, ): if "ROOM" in bin.name: - # TODO decide between MOZART or 7_1_4 for BRIRs - # cba_tmp = audio.fromtype("MOZART") cba_tmp = audio.fromtype("7_1_4") cba_tmp.fs = masa.fs -- GitLab