Skip to content

Commit 50d8438

Browse files
Feat: Add support for specifying a preamp in PEQs (#44)
1 parent 9b70817 commit 50d8438

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

music_assistant_models/dsp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,14 @@ class ParametricEQBand(DataClassDictMixin):
6868
class ParametricEQFilter(DSPFilterBase):
6969
"""Model for a Parametric EQ filter."""
7070

71+
preamp: float | None = 0.0
7172
type: Literal[DSPFilterType.PARAMETRIC_EQ] = DSPFilterType.PARAMETRIC_EQ
7273
bands: list[ParametricEQBand] = field(default_factory=list)
7374

7475
def validate(self) -> None:
7576
"""Validate the Parametric EQ filter."""
77+
if self.preamp and (not -60.0 <= self.preamp <= 60.0):
78+
raise ValueError("Preamp must be in the range -60.0 to 60.0 dB")
7679
# Validate bands
7780
for band in self.bands:
7881
if not 0.0 < band.frequency <= 100000.0:

0 commit comments

Comments
 (0)