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 # specify the data type of the output array to avoid the same_kind casting error mel_spectrogram = librosa.feature.melspectrogram(audio, dtype=np.float64) return mel_spectrogram # create the gradio app app = gr.Interface(audio_to_mel, "audio", "image") app.launch()