Commit 2eeef42c authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

Merge branch '81-multichannel-binaural-rendering-default-lfe-gain-not-applied' into 'main'

Resolve "Multichannel binaural rendering: Default LFE gain not applied"

See merge request !167
parents 0f505de1 451d015c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -195,8 +195,8 @@ def get_argparser():
    output_parser.add_argument(
        "-bl",
        "--bin_lfe_gain",
        type=float,
        help="Render LFE to binaural output with the specified gain (only valid for channel-based input, default = %(default)s)",
        type=parse_gain,
        help="Render LFE to binaural output with the specified gain (suffix with dB to use nonlinear, e.g. '10 dB', only valid for channel-based input, default = %(default)s)",
        default=BINAURAL_LFE_GAIN,
    )
    output_parser.add_argument(
+7 −7
Original line number Diff line number Diff line
@@ -128,7 +128,6 @@ def render_cba_to_binaural(
    IR, _, latency_smp = load_ir(cba.name, bin.name, bin_dataset)

    # render LFE
    if bin_lfe_gain is not None:
    bin_lfe, lfe_delay_ns = render_lfe_to_binaural(
        cba.audio, cba.fs, cba.lfe_index, bin_lfe_gain
    )
@@ -139,7 +138,6 @@ def render_cba_to_binaural(
    bin.audio = delay(bin.audio, bin.fs, -latency_smp, samples=True)

    # add LFE and rest
    if bin_lfe_gain is not None:
    bin.audio += bin_lfe

    bin.audio = resample_itu(bin, old_fs)
@@ -354,12 +352,14 @@ def render_lfe_to_binaural(
    x: np.ndarray,
    fs: Optional[int] = 48000,
    lfe_index: Optional[list] = None,
    LFE_gain: Optional[float] = BINAURAL_LFE_GAIN,
    LFE_gain: Optional[float] = None,
) -> Tuple[np.ndarray, int]:
    """
    Extract LFE from the given input and render
    it binaurally, accounting for delay
    """
    if LFE_gain is None:
        LFE_gain = BINAURAL_LFE_GAIN

    lfe = x[:, lfe_index].copy()

+1 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ def get_processing_chain(
                "out_fmt": post_fmt,
                "out_cutoff": tmp_lp_cutoff,
                "bin_dataset": post_cfg.get("bin_dataset"),
                "bin_lfe_gain": post_cfg.get("bin_lfe_gain"),
                "bin_lfe_gain": parse_gain(post_cfg.get("bin_lfe_gain")),
                "limit": post_cfg.get("limit", True),
                "trajectory": get_abs_path(post_cfg.get("trajectory", None)),
                "multiprocessing": cfg.multiprocessing,