Skip to content

Commit

Permalink
Fix: skip soxr resampler if loudnorm is present
Browse files Browse the repository at this point in the history
Due to a bug in ffmpeg
  • Loading branch information
marcelveldt committed Jan 16, 2025
1 parent 5df31b6 commit 3e5c6be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions music_assistant/helpers/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,11 @@ def get_ffmpeg_args( # noqa: PLR0915
input_format.sample_rate != output_format.sample_rate
or input_format.bit_depth > output_format.bit_depth
):
# prefer resampling with libsoxr due to its high quality
if libsoxr_support:
# prefer resampling with libsoxr due to its high quality (if its available)
# but skip libsoxr if loudnorm filter is present, due to this bug:
# https://trac.ffmpeg.org/ticket/11323
loudnorm_present = any("loudnorm" in f for f in filter_params)
if libsoxr_support and not loudnorm_present:
resample_filter = "aresample=resampler=soxr:precision=30"
else:
resample_filter = "aresample=resampler=swr"
Expand Down

0 comments on commit 3e5c6be

Please sign in to comment.