From 7b0a93d2f864d5273bd0f777cd824ae24c444e7c Mon Sep 17 00:00:00 2001 From: erogol Date: Thu, 26 Nov 2020 11:44:52 +0100 Subject: [PATCH] fix --- TTS/utils/audio.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TTS/utils/audio.py b/TTS/utils/audio.py index 30058117..9d25aeb7 100644 --- a/TTS/utils/audio.py +++ b/TTS/utils/audio.py @@ -323,11 +323,11 @@ class AudioProcessor(object): ### save and load ### def load_wav(self, filename, sr=None): - if sr is None: + if self.resample: + x, sr = librosa.load(filename, sr=self.sample_rate) + elif sr is None: x, sr = sf.read(filename) assert self.sample_rate == sr, "%s vs %s"%(self.sample_rate, sr) - elif self.resample: - x, sr = librosa.load(filename, sr=self.sample_rate) else: x, sr = librosa.load(filename, sr=sr) if self.do_trim_silence: diff --git a/setup.py b/setup.py index 2893036a..ab76317b 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ args, unknown_args = parser.parse_known_args() # Remove our arguments from argv so that setuptools doesn't see them sys.argv = [sys.argv[0]] + unknown_args -version = '0.0.6' +version = '0.0.7' # Adapted from https://github.com/pytorch/pytorch cwd = os.path.dirname(os.path.abspath(__file__))