You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you happen to find this repo like me and encounter errors when running noise.py, it's because some dependency libraries have changed their APIs, breaking this program. Here are some changes I made to fix that:
Add sox to PATH or edit pysndfx.dsp.py, adding cwd=your/sox/path to Popen in the AudioEffectsChain.__call__() method.
In the functions reduce_noise_centroid_s and reduce_noise_centroid_mb, threshold_l/h must be non-zero, as sox no longer accepts a 0 cutoff frequency for the low-shelf filter. I prefer threshold_l = np.max([np.min(cent), 20]) and threshold_h = np.min([np.max(cent), 20000]), for the common human voice range of 20-20kHz.
In the function output_file, librosa.output is deprecated. Use sp.io.wavfile.write(destination, sr, y) instead.
In the function trim_silence, librosa.get_duration now requires only keyword arguments like librosa.get_duration(y=y). Here, I recommend adding the sr keyword for any audio other than the default 22050 sample rate.
I also recommend adding sr=None to librosa.load in the read_file function to keep the native sample rate, resampling explicitly when you need another sample rate.
Dependencies version for me:
librosa 0.10.1
pysndfx 0.3.6
numpy 1.26.3
python_speech_features 0.6
scipy 1.11.4
The text was updated successfully, but these errors were encountered:
If you happen to find this repo like me and encounter errors when running noise.py, it's because some dependency libraries have changed their APIs, breaking this program. Here are some changes I made to fix that:
cwd=your/sox/path
toPopen
in theAudioEffectsChain.__call__()
method.reduce_noise_centroid_s
andreduce_noise_centroid_mb
, threshold_l/h must be non-zero, as sox no longer accepts a 0 cutoff frequency for the low-shelf filter. I preferthreshold_l = np.max([np.min(cent), 20])
andthreshold_h = np.min([np.max(cent), 20000])
, for the common human voice range of 20-20kHz.output_file
,librosa.output
is deprecated. Usesp.io.wavfile.write(destination, sr, y)
instead.trim_silence
,librosa.get_duration
now requires only keyword arguments likelibrosa.get_duration(y=y)
. Here, I recommend adding thesr
keyword for any audio other than the default 22050 sample rate.sr=None
tolibrosa.load
in theread_file
function to keep the native sample rate, resampling explicitly when you need another sample rate.Dependencies version for me:
The text was updated successfully, but these errors were encountered: