title: Error opening file because of an unknown format
body: <p>I read some Audio file, labeled them, and together with their path, save the path and emotion of each Audioo file in a csv file. Now I want to read their path from the file and open them but I get this Error:</p>
  <pre><code>---------------------------------------------------------------------------
  RuntimeError                              Traceback (most recent call last)
  File ~\.conda\envs\nhashemi\lib\site-packages\librosa\core\audio.py:155, in load(path, sr, mono, offset, duration, dtype, res_type)
      153 else:
      154     # Otherwise, create the soundfile object
  --&gt; 155     context = sf.SoundFile(path)
      157 with context as sf_desc:
  
  File ~\.conda\envs\nhashemi\lib\site-packages\soundfile.py:629, in SoundFile.__init__(self, file, mode, samplerate, channels, subtype, endian, format, closefd)
      627 self._info = _create_info_struct(file, mode, samplerate, channels,
      628                                  format, subtype, endian)
  --&gt; 629 self._file = self._open(file, mode_int, closefd)
      630 if set(mode).issuperset('r+') and self.seekable():
      631     # Move write position to 0 (like in Python file objects)
  
  File ~\.conda\envs\nhashemi\lib\site-packages\soundfile.py:1183, in SoundFile._open(self, file, mode_int, closefd)
     1182     raise TypeError(&quot;Invalid file: {0!r}&quot;.format(self.name))
  -&gt; 1183 _error_check(_snd.sf_error(file_ptr),
     1184              &quot;Error opening {0!r}: &quot;.format(self.name))
     1185 if mode_int == _snd.SFM_WRITE:
     1186     # Due to a bug in libsndfile version &lt;= 1.0.25, frames != 0
     1187     # when opening a named pipe in SFM_WRITE mode.
     1188     # See http://github.com/erikd/libsndfile/issues/77.
  
  File ~\.conda\envs\nhashemi\lib\site-packages\soundfile.py:1357, in _error_check(err, prefix)
     1356 err_str = _snd.sf_error_number(err)
  -&gt; 1357 raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace'))
  
  RuntimeError: Error opening 'C:/Users/external_dipf/Documents/Dataset/CREMA/AudioWAV/1001_IEO_FEA_HI.wav': File contains data in an unknown format.
  
  During handling of the above exception, another exception occurred:
  
  NoBackendError                            Traceback (most recent call last)
  Input In [553], in &lt;cell line: 3&gt;()
        1 emotion='fear'
        2 path = np.array(data_path.Path[data_path.Emotions==emotion])[1]
  ----&gt; 3 data, sampling_rate = librosa.load(path)
        4 create_waveplot(data, sampling_rate, emotion)
        5 create_spectrogram(data, sampling_rate, emotion)
  
  File ~\.conda\envs\nhashemi\lib\site-packages\librosa\util\decorators.py:88, in deprecate_positional_args.&lt;locals&gt;._inner_deprecate_positional_args.&lt;locals&gt;.inner_f(*args, **kwargs)
       86 extra_args = len(args) - len(all_args)
       87 if extra_args &lt;= 0:
  ---&gt; 88     return f(*args, **kwargs)
       90 # extra_args &gt; 0
       91 args_msg = [
       92     &quot;{}={}&quot;.format(name, arg)
       93     for name, arg in zip(kwonly_args[:extra_args], args[-extra_args:])
       94 ]
  
  File ~\.conda\envs\nhashemi\lib\site-packages\librosa\core\audio.py:174, in load(path, sr, mono, offset, duration, dtype, res_type)
      172 if isinstance(path, (str, pathlib.PurePath)):
      173     warnings.warn(&quot;PySoundFile failed. Trying audioread instead.&quot;, stacklevel=2)
  --&gt; 174     y, sr_native = __audioread_load(path, offset, duration, dtype)
      175 else:
      176     raise (exc)
  
  File ~\.conda\envs\nhashemi\lib\site-packages\librosa\core\audio.py:198, in __audioread_load(path, offset, duration, dtype)
      192 &quot;&quot;&quot;Load an audio buffer using audioread.
      193 
      194 This loads one block at a time, and then concatenates the results.
      195 &quot;&quot;&quot;
      197 y = []
  --&gt; 198 with audioread.audio_open(path) as input_file:
      199     sr_native = input_file.samplerate
      200     n_channels = input_file.channels
  
  File ~\.conda\envs\nhashemi\lib\site-packages\audioread\__init__.py:116, in audio_open(path, backends)
      113         pass
      115 # All backends failed!
  --&gt; 116 raise NoBackendError()
  
  NoBackendError: 
  </code></pre>
  <p>Here is my code to label and specify the label (emotion) of each file</p>
  <pre><code>CREMA =&quot;C:/Users/external_dipf/Documents/Dataset/CREMA/AudioWAV/&quot;
  crema_directory_list = os.listdir(CREMA)
  
  file_emotion = []
  file_path = []
  
  for file in crema_directory_list:
      # storing file paths
      file_path.append(CREMA + file)
      # storing file emotions
      part=file.split('_')
      if part[2] == 'SAD':
          file_emotion.append('sad')
      elif part[2] == 'ANG':
          file_emotion.append('angry')
      elif part[2] == 'DIS':
          file_emotion.append('disgust')
      elif part[2] == 'FEA':
          file_emotion.append('fear')
      elif part[2] == 'HAP':
          file_emotion.append('happy')
      elif part[2] == 'NEU':
          file_emotion.append('neutral')
      else:
          file_emotion.append('Unknown')
          
  # dataframe for emotion of files
  emotion_df = pd.DataFrame(file_emotion, columns=['Emotions'])
  
  # dataframe for path of files.
  path_df = pd.DataFrame(file_path, columns=['Path'])
  CREMA_df = pd.concat([emotion_df, path_df], axis=1)
  CREMA_df.head()
  </code></pre>
  <p>Here is were I save them in a CSV file</p>
  <pre><code>data_path = pd.concat([CREMA_df, RAVDESS_df, TESS_df, SAVEE_df], axis = 0)
  data_path.to_csv(&quot;data_path.csv&quot;,index=False)
  data_path.head()
  </code></pre>
  <p>and here I am trying to read the file. The error is related to the CREMA dataset.</p>
  <pre><code>emotion='fear'
  path = np.array(data_path.Path[data_path.Emotions==emotion])[1]
  data, sampling_rate = librosa.load(path)
  create_waveplot(data, sampling_rate, emotion)
  create_spectrogram(data, sampling_rate, emotion)
  Audio(path)
  </code></pre>
  <p>I checked the path file, everything was correct. I can open other wav files. My librosa version is 0.9.1</p>