import gradio as gr class Hit(): def __init__(self): self.score = 1 self.payload = { "audio_path": "https://synthia-research.s3.amazonaws.com/music_db/7fbb0c4de0e4bdf5e1dec8f3e803174b.mp3" } def sound_search(query): hits = [Hit() for _ in range(3)] return [ gr.Audio( hit.payload['audio_path'], label=f"score: {hit.score}") for hit in hits ] with gr.Blocks() as demo: gr.Markdown( """# Sound search database """ ) inp = gr.Textbox(placeholder="What sound are you looking for ?") out = [gr.Audio(label=f"{x}") for x in range(3)] # Necessary to have different objs inp.change(sound_search, inp, out) demo.launch()