mirror of https://github.com/coqui-ai/TTS.git
Make audio folder and save audio with scipy
parent
30fea0b957
commit
34eeaee58b
2
train.py
2
train.py
|
@ -474,7 +474,7 @@ if __name__ == '__main__':
|
|||
OUT_PATH = create_experiment_folder(OUT_PATH, c.model_name, args.debug)
|
||||
CHECKPOINT_PATH = os.path.join(OUT_PATH, 'checkpoints')
|
||||
AUDIO_PATH = os.path.join(OUT_PATH, 'test_audios')
|
||||
os.mkdir(AUDIO_PATH)
|
||||
os.makedirs(AUDIO_PATH, exist_ok=True)
|
||||
shutil.copyfile(args.config_path, os.path.join(OUT_PATH, 'config.json'))
|
||||
|
||||
# setup tensorboard
|
||||
|
|
|
@ -3,6 +3,7 @@ import librosa
|
|||
import pickle
|
||||
import copy
|
||||
import numpy as np
|
||||
import scipy
|
||||
from scipy import signal
|
||||
|
||||
_mel_basis = None
|
||||
|
@ -38,7 +39,8 @@ class AudioProcessor(object):
|
|||
|
||||
def save_wav(self, wav, path):
|
||||
wav_norm = wav * (32767 / max(0.01, np.max(np.abs(wav))))
|
||||
librosa.output.write_wav(path, wav_norm.astype(np.int16), self.sample_rate)
|
||||
# librosa.output.write_wav(path, wav_norm.astype(np.int16), self.sample_rate)
|
||||
scipy.io.wavfile.write(path, self.sample_rate, wav.astype(np.int16))
|
||||
|
||||
def _linear_to_mel(self, spectrogram):
|
||||
global _mel_basis
|
||||
|
|
Loading…
Reference in New Issue