yongxuUSTC/sednn

Global name 'librosa' is not defined

Reagan1947 opened this issue · 5 comments

Sednn/mixture2clean_dnn/preparedata.py

def read_audio(path, target_fs=None):
    (audio, fs) = soundfile.read(path)
    if audio.ndim > 1:
        audio = np.mean(audio, axis=1)
    if target_fs is not None and fs != target_fs:
        audio = librosa.resample(audio, orig_sr=fs, target_sr=target_fs)
        fs = target_fs
    return audio, fs
  • librosa is not define, Should import pack librosa.
  • Moreover librosa will also cause TypeError: expected string or buffer
    pip install 'joblib==0.11' --force-reinstall will solve it.

Is import of "librosa" package a must? at preparedata.py