gradio-app/gradio

Have the possibility to output audio in gr.Dataframe

Closed this issue · 3 comments

  • I have searched to see if a similar issue already exists.

I currently want to create a demo where I associate some values to a wide range of audios, and it would be great if I could use gr.Dataframe with a column of audio samples, do you think it would be possible to have this ?

Many thanks!

Also related: #2678

And #8257 could be the patterned used to enable this I think

This is already possible actually, by setting the datatype="markdown" in gr.DataFrame!

Here's a representative example:

import gradio as gr

with gr.Blocks() as demo:
    gr.DataFrame([["<audio src='/file=cantina.wav' controls></audio>"]], datatype="markdown")
    
demo.launch(allowed_paths=["cantina.wav"])

So I think we can close, but lmk if I'm missing anything!