Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API breaking changes summary #9

Open
ZZZZzzzzac opened this issue Jul 10, 2024 · 0 comments
Open

API breaking changes summary #9

ZZZZzzzzac opened this issue Jul 10, 2024 · 0 comments

Comments

@ZZZZzzzzac
Copy link

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:

  • Install sox if you haven't already: https://sourceforge.net/projects/sox/ (common for Windows users like me).
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant