How to suppress FutureWarning for librosa.util.fix_length

1,133 views
Skip to first unread message

Good Robot

unread,
Apr 27, 2022, 12:33:40 PM4/27/22
to librosa
Hello,

I have been recently getting warnings:

FutureWarning: Pass size=88200 as keyword args. From version 0.10 passing these as positional arguments will result in an error
  trimmed = librosa.util.fix_length(audio, int(sample_rate * durationSeconds))

How to go about suppressing these warning as it is filling up my console window and having me to look for my related "print" results.

Any help to suppress these warning are greatly appreciated.  

Also, how to fix these warnings?

Thanks! 

Brian McFee

unread,
Apr 27, 2022, 12:35:33 PM4/27/22
to librosa
As the warning message says, use a keyword argument here:

  trimmed = librosa.util.fix_length(audio, size=int(sample_rate * durationSeconds))   # emphasis added
Reply all
Reply to author
Forward
0 new messages