Skip to content

Commit

Permalink
Add comment to code
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jan 3, 2025
1 parent 865cf75 commit ffe0389
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions audiofile/core/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ def read(
if duration is not None and duration != 0:
duration /= sampling_rate
if sampling_rate is None:
# Infer sampling rate using mediainfo before conversion,
# as ffmpeg does ignore the original sampling rate for opus files,
# see:
# * https://trac.ffmpeg.org/ticket/5240
# * https://github.com/audeering/audiofile/issues/157
from audiofile.core.info import sampling_rate as get_sampling_rate

sampling_rate = get_sampling_rate(file)
Expand Down

0 comments on commit ffe0389

Please sign in to comment.