mirror of https://github.com/coqui-ai/TTS.git
small fixes
parent
8c9e1c9e58
commit
d57f416957
|
@ -387,10 +387,9 @@ class AudioProcessor(object):
|
|||
x = self.sound_norm(x)
|
||||
return x
|
||||
|
||||
def save_wav(self, wav, path, sample_rate=None):
|
||||
sample_rate = self.sample_rate if sample_rate is None else sample_rate
|
||||
def save_wav(self, wav, path, sr=None):
|
||||
wav_norm = wav * (32767 / max(0.01, np.max(np.abs(wav))))
|
||||
scipy.io.wavfile.write(path, sample_rate, wav_norm.astype(np.int16))
|
||||
scipy.io.wavfile.write(path, sr if sr else self.sample_rate, wav_norm.astype(np.int16))
|
||||
|
||||
@staticmethod
|
||||
def mulaw_encode(wav, qc):
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import torch
|
||||
import torch.nn.functional as F
|
||||
import torch.nn as nn
|
||||
from torch.nn import Conv1d, ConvTranspose1d, AvgPool1d, Conv2d
|
||||
from torch.nn.utils import weight_norm, remove_weight_norm, spectral_norm
|
||||
from torch.nn import Conv1d, ConvTranspose1d
|
||||
from torch.nn.utils import weight_norm, remove_weight_norm
|
||||
|
||||
LRELU_SLOPE = 0.1
|
||||
|
||||
|
@ -115,6 +115,7 @@ class HifiganGenerator(torch.nn.Module):
|
|||
resblock_kernel_sizes, upsample_kernel_sizes,
|
||||
upsample_initial_channel, upsample_factors):
|
||||
super().__init__()
|
||||
self.inference_padding = 5
|
||||
self.num_kernels = len(resblock_kernel_sizes)
|
||||
self.num_upsamples = len(upsample_factors)
|
||||
self.conv_pre = weight_norm(
|
||||
|
|
Loading…
Reference in New Issue