Update audio.py

pull/10/head
Eren G 2018-08-03 15:37:37 +02:00
parent 59738e9676
commit abf89b107b
2 changed files with 3 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class AudioProcessor(object):
def save_wav(self, wav, path):
wav *= 32767 / max(0.01, np.max(np.abs(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):
global _mel_basis

View File

@ -1,4 +1,5 @@
import os
import sys
import librosa
import pickle
import copy
@ -45,7 +46,7 @@ class AudioProcessor(object):
def save_wav(self, wav, path):
wav *= 32767 / max(0.01, np.max(np.abs(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, ):
n_fft = int((self.num_freq - 1) * 2)