Pass the bed positions to the HRTF renderer

This commit is contained in:
TheM14 committed 2026-10-30 05:22:06 +08:00
1 parent 5c4f876411
commit 247e2a90b6
2 files changed
+6 -2

No files matched your search

+1
View File
@@ -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,
+5 -2
View File
@@ -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)