mirror of https://github.com/coqui-ai/TTS.git
Update audio.py
parent
59738e9676
commit
abf89b107b
|
@ -40,7 +40,7 @@ class AudioProcessor(object):
|
||||||
def save_wav(self, wav, path):
|
def save_wav(self, wav, path):
|
||||||
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
|
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
|
||||||
librosa.output.write_wav(
|
librosa.output.write_wav(
|
||||||
path, wav.astype(np.float), self.sample_rate, norm=True)
|
path, wav.astype(np.int16), self.sample_rate)
|
||||||
|
|
||||||
def _linear_to_mel(self, spectrogram):
|
def _linear_to_mel(self, spectrogram):
|
||||||
global _mel_basis
|
global _mel_basis
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import librosa
|
import librosa
|
||||||
import pickle
|
import pickle
|
||||||
import copy
|
import copy
|
||||||
|
@ -45,7 +46,7 @@ class AudioProcessor(object):
|
||||||
def save_wav(self, wav, path):
|
def save_wav(self, wav, path):
|
||||||
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
|
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
|
||||||
librosa.output.write_wav(
|
librosa.output.write_wav(
|
||||||
path, wav.astype(np.float), self.sample_rate, norm=True)
|
path, wav.astype(np.int16), self.sample_rate)
|
||||||
|
|
||||||
def _stft_parameters(self, ):
|
def _stft_parameters(self, ):
|
||||||
n_fft = int((self.num_freq - 1) * 2)
|
n_fft = int((self.num_freq - 1) * 2)
|
||||||
|
|
Loading…
Reference in New Issue