import gradio as gr | |
import numpy as np | |
import librosa | |
# import the librosa library for converting audio to a Mel spectrogram image | |
def audio_to_mel(audio): | |
# convert the audio to a Mel spectrogram image using librosa | |
mel_spectrogram = librosa.feature.melspectrogram(audio) | |
return mel_spectrogram | |
# create the gradio app | |
app = gr.Interface(audio_to_mel, "audio", "image") | |
app.launch() |