filter-graph: add gain option to sofa

So that we can apply the gain to the IR. This is more efficient than
doing a volume after the convolution.

See #5098
This commit is contained in:
Wim Taymans 2026-02-02 16:21:03 +01:00
parent f60e03b4ef
commit 3c80f0fb3e
3 changed files with 50 additions and 21 deletions

View file

@ -19,6 +19,8 @@ context.modules = [
name = spFL
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
# The gain depends on the .sofa file in use
gain = 0.5
}
control = {
"Azimuth" = 30.0
@ -32,6 +34,7 @@ context.modules = [
name = spFR
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 330.0
@ -45,6 +48,7 @@ context.modules = [
name = spFC
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 0.0
@ -58,6 +62,7 @@ context.modules = [
name = spRL
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 150.0
@ -71,6 +76,7 @@ context.modules = [
name = spRR
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 210.0
@ -84,6 +90,7 @@ context.modules = [
name = spSL
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 90.0
@ -97,6 +104,7 @@ context.modules = [
name = spSR
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 270.0
@ -110,6 +118,7 @@ context.modules = [
name = spLFE
config = {
filename = "~/.config/hrtf-sofa/hrtf b_nh724.sofa"
gain = 0.5
}
control = {
"Azimuth" = 0.0
@ -120,26 +129,28 @@ context.modules = [
{ type = builtin label = mixer name = mixL
control = {
"Gain 1" = 0.5
"Gain 2" = 0.5
"Gain 3" = 0.5
"Gain 4" = 0.5
"Gain 5" = 0.5
"Gain 6" = 0.5
"Gain 7" = 0.5
"Gain 8" = 0.5
# Set individual left mixer gain if needed
#"Gain 1" = 1.0
#"Gain 2" = 1.0
#"Gain 3" = 1.0
#"Gain 4" = 1.0
#"Gain 5" = 1.0
#"Gain 6" = 1.0
#"Gain 7" = 1.0
#"Gain 8" = 1.0
}
}
{ type = builtin label = mixer name = mixR
control = {
"Gain 1" = 0.5
"Gain 2" = 0.5
"Gain 3" = 0.5
"Gain 4" = 0.5
"Gain 5" = 0.5
"Gain 6" = 0.5
"Gain 7" = 0.5
"Gain 8" = 0.5
# Set individual right mixer gain if needed
#"Gain 1" = 1.0
#"Gain 2" = 1.0
#"Gain 3" = 1.0
#"Gain 4" = 1.0
#"Gain 5" = 1.0
#"Gain 6" = 1.0
#"Gain 7" = 1.0
#"Gain 8" = 1.0
}
}
]