Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
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")
|