Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables using newer versions of librosa #208

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions notebooks/NB4a - Alternative Model (Preprocessing).ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"import math, pickle, os, glob\n",
"import numpy as np\n",
"from utils.display import *\n",
"from utils.dsp import *"
"from utils.dsp import *\n",
"import soundfile as sf"
]
},
{
Expand Down Expand Up @@ -157,7 +158,7 @@
"metadata": {},
"outputs": [],
"source": [
"librosa.output.write_wav(DATA_PATH + 'test_quant.wav', x, sr=sample_rate)"
"sf.write(DATA_PATH + 'test_quant.wav', x, sample_rate, subtype='PCM_24')"
]
},
{
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
numpy==1.16.2
librosa==0.6.3
librosa
soundfile
matplotlib
unidecode
inflect
nltk
nltk
3 changes: 2 additions & 1 deletion utils/dsp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import math
import numpy as np
import librosa
import soundfile as sf
from utils import hparams as hp
from scipy.signal import lfilter

Expand All @@ -20,7 +21,7 @@ def load_wav(path):


def save_wav(x, path):
librosa.output.write_wav(path, x.astype(np.float32), sr=hp.sample_rate)
sf.write(path, x.astype(np.float32), hp.sample_rate, subtype='PCM_24')


def split_signal(x):
Expand Down