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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions encoder/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


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

webrtcvad=None

int16_max = (2 ** 15) - 1
Expand Down