Skip to content
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