asigalov61 commited on
Commit
4a74f82
1 Parent(s): e476fc7

Update midi_to_colab_audio.py

Browse files
Files changed (1) hide show
  1. midi_to_colab_audio.py +3 -3
midi_to_colab_audio.py CHANGED
@@ -3021,13 +3021,13 @@ def midi_to_colab_audio(midi_file,
3021
  if max_val != 0:
3022
  ss = (ss / max_val) * np.iinfo(np.int16).max
3023
  ss = ss.astype(np.int16)
 
 
 
3024
 
3025
  ss = ss.swapaxes(1, 0)
3026
 
3027
  raw_audio = normalize_volume(ss, volume_scale)
3028
-
3029
- if output_for_gradio:
3030
- raw_audio = np.transpose(raw_audio)
3031
 
3032
  return raw_audio
3033
 
 
3021
  if max_val != 0:
3022
  ss = (ss / max_val) * np.iinfo(np.int16).max
3023
  ss = ss.astype(np.int16)
3024
+
3025
+ if output_for_gradio:
3026
+ return ss
3027
 
3028
  ss = ss.swapaxes(1, 0)
3029
 
3030
  raw_audio = normalize_volume(ss, volume_scale)
 
 
 
3031
 
3032
  return raw_audio
3033