Last active
April 16, 2023 21:53
-
-
Save tikhonova/f137cd52ee18229e0d6a11be98baa9e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reduce_noise(file_path: str, file: str, dest_path: str) -> None: | |
# load data | |
rate, data = wavfile.read(os.path.join(file_path, file)) | |
reduced_noise = nr.reduce_noise(y=data, sr=rate) | |
# perform noise reduction | |
try: | |
wavfile.write(os.path.join(dest_path, file), rate, reduced_noise) | |
except Exception(): | |
pass | |
# via https://github.com/tikhonova/what_would_alan_watts_say/blob/master/speech_synthesis/1_reduce_noise.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment