Skip to content

Commit

Permalink
Merge pull request keithito#210 from keithito/librosa
Browse files Browse the repository at this point in the history
Fix for librosa 0.6
  • Loading branch information
keithito authored Sep 5, 2018
2 parents d77e179 + 91f4835 commit cb2dbc8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import math
import numpy as np
import tensorflow as tf
from scipy import signal
import scipy
from hparams import hparams


Expand All @@ -13,15 +13,15 @@ def load_wav(path):

def save_wav(wav, path):
wav *= 32767 / max(0.01, np.max(np.abs(wav)))
librosa.output.write_wav(path, wav.astype(np.int16), hparams.sample_rate)
scipy.io.wavfile.write(path, hparams.sample_rate, wav.astype(np.int16))


def preemphasis(x):
return signal.lfilter([1, -hparams.preemphasis], [1], x)
return scipy.signal.lfilter([1, -hparams.preemphasis], [1], x)


def inv_preemphasis(x):
return signal.lfilter([1], [1, -hparams.preemphasis], x)
return scipy.signal.lfilter([1], [1, -hparams.preemphasis], x)


def spectrogram(y):
Expand Down

0 comments on commit cb2dbc8

Please sign in to comment.