问题
I am trying to perform STFT on a bunch of sound files and I get this error. The path of the files which I am trying to perform STFT is correct but still, I get this error.
import librosa
import io
import numpy as np
import tensorflow as tf
import os
import glob
path_te = "C:\Users\aanum\OneDrive\Documents\Deep Learning\timit-homework\te"
files = os.listdir(path_te)
for file in sorted(files):
if file.startswith("tex"):
file_path = path_te2 + "/" + file
#file_path = 'r' + "'" + str(file_path) + "'"
print(file_path)
st, sr=librosa.load(file_path, sr=None)
Output:
C:/Users/aanum/OneDrive/Documents/Deep Learning/timit-homework/te/tex0000.wav
---------------------------------------------------------------------------
NoBackendError Traceback (most recent call last)
<ipython-input-54-4df25548d204> in <module>
7 #file_path = 'r' + "'" + str(file_path) + "'"
8 print(file_path)
----> 9 st, sr=librosa.load(file_path, sr=None)
10 X=librosa.stft(st, n_fft=1024, hop_length=512)
11 X_abs = abs(X)
~\Anaconda3\envs\DeepLearning\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)
117
118 y = []
--> 119 with audioread.audio_open(os.path.realpath(path)) as input_file:
120 sr_native = input_file.samplerate
121 n_channels = input_file.channels
~\Anaconda3\envs\DeepLearning\lib\site-packages\audioread\__init__.py in audio_open(path, backends)
114
115 # All backends failed!
--> 116 raise NoBackendError()
NoBackendError
Can anyone tell me why I have this error?
来源:https://stackoverflow.com/questions/58810320/no-backend-error-while-reading-files-in-python