From 247e2a90b67d167b971394de420069d4d2f88f6e Mon Sep 17 00:00:00 2001 From: TheM14 Date: Fri, 30 Oct 2026 05:22:06 +0800 Subject: [PATCH] Pass the bed positions to the HRTF renderer --- main.py | 1 + src/rosella_binaural_renderer.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 04b50ed..a1cbc54 100644 --- a/main.py +++ b/main.py @@ -826,6 +826,7 @@ def main(argv=None): timings, "create_binaural_renderer", RosellaBinauralRenderer, hrtf_source["path"], + bed_channels=getattr(index, "bed_channels", ()), mode=binaural_render_mode, object_delay_samples=args.object_delay_samples, tail_seconds=args.binaural_tail_seconds, diff --git a/src/rosella_binaural_renderer.py b/src/rosella_binaural_renderer.py index 5524655..c1964f2 100644 --- a/src/rosella_binaural_renderer.py +++ b/src/rosella_binaural_renderer.py @@ -14,6 +14,7 @@ from pathlib import Path import numpy as np +from bed_layout import bed_object_positions from binaural_metadata import OamdPositionTimeline from rosella_core import RosellaRenderer from rosella_direct import BINAURAL_PROFILE_NAMES @@ -71,7 +72,8 @@ class RosellaBinauralRenderer: tail_seconds: float = 5.0, output_gain: float = 1.0, chunk_frames: int = 64, - room_impulse_slots: int = 4096): + room_impulse_slots: int = 4096, + bed_channels=None): if mode not in BINAURAL_PROFILE_NAMES: raise ValueError("binaural mode must be near, mid, or far") if int(object_delay_samples) < 0: @@ -111,7 +113,8 @@ class RosellaBinauralRenderer: room_impulse_slots=room_impulse_slots) self.hybrid_synthesis = HybridSynthesis(OUTPUT_CHANNELS, self.kernel_data) self.qmf_synthesis = QmfSynthesis(OUTPUT_CHANNELS, self.kernel_data) - self.timeline = OamdPositionTimeline(15) + self.timeline = OamdPositionTimeline( + 15, bed_positions=bed_object_positions(bed_channels or ())) self._input_buffer = np.empty( (self.chunk_samples, SOURCE_CHANNELS), dtype=np.float64)