BrunoHays commited on
Commit
8882ba0
1 Parent(s): cad6b6c

Update multilingual-TEDX-fr.py

Browse files
Files changed (1) hide show
  1. multilingual-TEDX-fr.py +2 -1
multilingual-TEDX-fr.py CHANGED
@@ -199,7 +199,8 @@ class TEDX(datasets.GeneratorBasedBuilder):
199
  A NumPy array containing the audio waveform, in float32 dtype.
200
  """
201
  import librosa
202
- return librosa.load(file, sr=sr)
 
203
  try:
204
  # This launches a subprocess to decode audio while down-mixing and resampling as necessary.
205
  # Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
 
199
  A NumPy array containing the audio waveform, in float32 dtype.
200
  """
201
  import librosa
202
+ with open(file, "rb") as f:
203
+ return librosa.load(f, sr=sr)
204
  try:
205
  # This launches a subprocess to decode audio while down-mixing and resampling as necessary.
206
  # Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.