Skip to content

Commit

Permalink
Feat: Add support for PEQ preamp
Browse files Browse the repository at this point in the history
  • Loading branch information
maximmaxim345 committed Jan 30, 2025
1 parent ddaa929 commit d1d7453
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions music_assistant/helpers/dsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def filter_to_ffmpeg_params(dsp_filter: DSPFilter, input_format: AudioFormat) ->
List of FFmpeg filter parameter strings
"""
filter_params = []
preamp = 0

if isinstance(dsp_filter, ParametricEQFilter):
preamp = dsp_filter.preamp
for b in dsp_filter.bands:
if not b.enabled:
continue
Expand Down Expand Up @@ -109,4 +111,7 @@ def filter_to_ffmpeg_params(dsp_filter: DSPFilter, input_format: AudioFormat) ->
f"equalizer=frequency=9000:width=18000:width_type=h:gain={dsp_filter.treble_level}"
)

if preamp != 0:
filter_params.insert(0, f"volume={preamp}dB")

return filter_params

0 comments on commit d1d7453

Please sign in to comment.