gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Audio Component help

Open HeChengHui opened this issue 4 months ago • 0 comments

Describe the bug

I am running my gradio script on my server and hosting it on ngrock so i can access it via my mobile phone browser.
I am using the audio component to either allow file upload or record their audio first before processing it. i am facing the following problems:

  1. audio = gr.Audio(label="xx (Audio)", type="filepath", show_download_button=True, autoplay = False) After recording the audio, sometimes the playback stops working, but i can still scroll through the waveform, and press the forward/backward buttons. Subsequent captures will also be bugged until i refresh the page. However, i can still process the recorded audio file, just the playback is not working.

def display_wait():
    gr.Info("Please Wait, Uploading Audio...")
def display_done():
    gr.Info("Complete")

audio = gr.Audio(label="xx (Audio)", type="filepath", show_download_button=True, autoplay = False)
audio.stop_recording(display_wait)
audio.input(display_done)

Tried to use event listeners to make user wait before pressing anything else.
a. Still stops after 3rd capture b. somehow after i press the red button to stop recording, display_done always appears before display_wait. c. (minor) input and change event listener also procs when i clear Audio. How do i stop that behavior and make it proc when something is sent to Audio?

Have you searched existing issues? 🔎

  • [X] I have searched and found no existing issues

Reproduction

NA

Screenshot

No response

Logs

No response

System Info

Python==3.11.9
# Name                    Version                   Build  Channel
gradio                    4.44.1                   pypi_0    pypi
gradio-client             1.3.0                    pypi_0    pypi

Severity

Blocking usage of gradio

HeChengHui avatar Oct 10 '24 09:10 HeChengHui