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

Skip trim_long_silences in preprocess_wav if webrtcvad not available #376

Merged
6 commits merged into from Jun 26, 2020
Merged

Skip trim_long_silences in preprocess_wav if webrtcvad not available #376

6 commits merged into from Jun 26, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jun 25, 2020

Here is an idea for resolving #375 . I also suggest removing webrtcvad from requirements.txt to make installation easier for Windows users. The training instructions will need to include a step to install webrtcvad if using LibriSpeech or LibriTTS. Since training setup is already manual I find that preferable to including it in requirements.txt and complicating the install for everyone else.

@ghost ghost requested a review from CorentinJ June 25, 2020 04:56
@CorentinJ
Copy link
Owner

Can do, but add a warning when the import fails because denoising should be enabled by default

@ghost
Copy link
Author

ghost commented Jun 25, 2020

Good idea. I added a print statement if the import fails. Let me know if you prefer an actual warning instead.

encoder/audio.py Outdated
@@ -5,10 +5,12 @@
import numpy as np
import librosa
import struct
import warnings
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import warnings
from warninings import warn

encoder/audio.py Outdated

try:
import webrtcvad
except:
print("WARNING: Unable to import 'webrtcvad'. Please install for better noise removal.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("WARNING: Unable to import 'webrtcvad'. Please install for better noise removal.")
warn("Unable to import 'webrtcvad'. This package enables noise removal and is recommended.")

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This latest commit implements your suggestions. Let me know if you think of anything else

@ghost
Copy link
Author

ghost commented Jun 25, 2020

I added a check in each of the preprocess scripts to verify that webrtcvad is installed before proceeding. The check can be disabled but the user is encouraged to install it. Can you take a look at this and tell me whether you want to keep this feature, or modify it?

We can also update the training wiki page to remind the user to install webrtcvad since it is no longer in requirements.txt

encoder_preprocess.py Outdated Show resolved Hide resolved
@ghost ghost requested a review from CorentinJ June 25, 2020 16:02
@ghost ghost merged commit 1e16877 into CorentinJ:master Jun 26, 2020
@ghost ghost deleted the 375_webrtcvad_optional branch June 26, 2020 08:46
@ghost ghost mentioned this pull request Jun 26, 2020
@ghost ghost mentioned this pull request Feb 3, 2021
This pull request was closed.
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

Successfully merging this pull request may close these issues.

1 participant