nakas commited on
Commit
b5b432f
1 Parent(s): 027cd67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -11,7 +11,10 @@ def mel_to_audio(mel_spectrogram):
11
  # convert the Mel spectrogram image to audio using librosa
12
  # specify the data type of the output array to avoid the same_kind casting error
13
  audio = librosa.feature.inverse.mel_to_audio(mel_spectrogram, dtype=np.float64)
14
- return audio
 
 
 
15
 
16
  # create the gradio app
17
  app = gr.Interface(mel_to_audio, "image", "audio")
 
11
  # convert the Mel spectrogram image to audio using librosa
12
  # specify the data type of the output array to avoid the same_kind casting error
13
  audio = librosa.feature.inverse.mel_to_audio(mel_spectrogram, dtype=np.float64)
14
+ # Save the audio to a file
15
+ output = 'output.wav'
16
+ librosa.output.write_wav(output, audio, 44100)
17
+ return output
18
 
19
  # create the gradio app
20
  app = gr.Interface(mel_to_audio, "image", "audio")