fix: 音量持久化(node.volume 进配置 + 开时补写) -- 根因是 filter-chain 重建后音量回 1.0 导致爆音反复; feat: 电平贝塞尔图 + Web 控制台
This commit is contained in:
@@ -77,6 +77,12 @@ def default_sink_name() -> str:
|
||||
_TARGET = os.environ.get("CINEMA_SPATIAL_TARGET") or default_sink_name()
|
||||
TARGET_PROP = f'node.target = "{_TARGET}" ' if _TARGET else ""
|
||||
|
||||
# 虚拟声卡的音量。★ 必须写进配置, 否则重建后不保留:
|
||||
# filter-chain 重建时新节点没有历史音量, 会回到 1.0 → 整链直接削波爆音。
|
||||
# 0.25 ≈ -12dB, 给电影那种高峰值因子瞬态留足余量(见 README 第 10、11 条)。
|
||||
VOLUME = os.environ.get("CINEMA_SPATIAL_VOLUME", "0.25")
|
||||
VOL_PROP = f"node.volume = {VOLUME} " if VOLUME else ""
|
||||
|
||||
|
||||
def hrir_block(indent: str) -> list[str]:
|
||||
"""12 个卷积器 + 6 个分发 + 左右耳混音。输入端口: cp<dir>:In"""
|
||||
@@ -115,7 +121,7 @@ def sink_51() -> list[str]:
|
||||
L += [" ]",
|
||||
' inputs = [ "cpFL:In" "cpFR:In" "cpFC:In" "cpLFE:In" "cpBL:In" "cpBR:In" ]',
|
||||
' outputs = [ "mixL:Out" "mixR:Out" ]', " }",
|
||||
" capture.props = { node.name = cinema_spatial_sink media.class = Audio/Sink "
|
||||
f" capture.props = {{ {VOL_PROP}node.name = cinema_spatial_sink media.class = Audio/Sink "
|
||||
"audio.channels = 6 audio.position = [ FL FR FC LFE BL BR ] }",
|
||||
f' playback.props = {{ node.name = cinema_spatial_out {TARGET_PROP}'
|
||||
"audio.channels = 2 audio.position = [ FL FR ] }",
|
||||
@@ -165,7 +171,7 @@ def sink_upmix() -> list[str]:
|
||||
L += [" ]",
|
||||
' inputs = [ "copyFL:In" "copyFR:In" ]',
|
||||
' outputs = [ "mixL:Out" "mixR:Out" ]', " }",
|
||||
" capture.props = { node.name = cinema_spatial_up_sink media.class = Audio/Sink "
|
||||
f" capture.props = {{ {VOL_PROP}node.name = cinema_spatial_up_sink media.class = Audio/Sink "
|
||||
"audio.channels = 2 audio.position = [ FL FR ] }",
|
||||
f' playback.props = {{ node.name = cinema_spatial_up_out {TARGET_PROP}'
|
||||
"audio.channels = 2 audio.position = [ FL FR ] }",
|
||||
|
||||
Reference in New Issue
Block a user