teticio commited on
Commit
9d6c224
1 Parent(s): c0cf681

fix load audio from file

Browse files
Files changed (1) hide show
  1. audiodiffusion/mel.py +6 -3
audiodiffusion/mel.py CHANGED
@@ -46,9 +46,12 @@ class Mel:
46
  audio_file (str): must be a file on disk due to Librosa limitation or
47
  raw_audio (np.ndarray): audio as numpy array
48
  """
49
- self.y, _ = librosa.load(
50
- audio_file,
51
- mono=True) if audio_file is not None else raw_audio, None
 
 
 
52
 
53
  def get_number_of_slices(self) -> int:
54
  """Get number of slices in audio.
 
46
  audio_file (str): must be a file on disk due to Librosa limitation or
47
  raw_audio (np.ndarray): audio as numpy array
48
  """
49
+ if audio_file is not None:
50
+ self.y, _ = librosa.load(
51
+ audio_file,
52
+ mono=True)
53
+ else:
54
+ self.y = raw_audio
55
 
56
  def get_number_of_slices(self) -> int:
57
  """Get number of slices in audio.