gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.71k stars 2.55k forks source link

Recorded audio (microphone) is duplicated and is in x2 speed (linux/firefox) #7284

Closed guillaume-girard closed 1 week ago

guillaume-girard commented 9 months ago

Describe the bug

I'm trying to use the audio component on gradio 4.x to record audio over microphone. I can launch the record but when I click the STOP button the audio is duplicated (there is 1 audio but the record is audible twice in a row) and it is speed up (times 2 I guess...)

Note that I've got the problem on the official audio component demo as well but the audio appears normally for a short period of time (less than a sec) and then appears duplicated.

This bug seems to only appears with Firefox on Linux (linux/chromium is OK and MacOS/Firefox is OK). However I selected "Blocking usage of gradio" severity because our app purpose is to go online, therefore we are not able to upgrade from gradio 3.50.2 for now.

Have you searched existing issues? πŸ”Ž

Reproduction

import gradio as gr

with gr.Blocks() as demo:
    gr.Audio()

demo.launch()

Screenshot

This screen record is from the official the official audio component demo

issue_gradio_audio_component

Logs

No error or warning from python local server, however the in-browser javascript console got this warning that repeats itself indefinitely as soon as the bug occurs:

Invalid URI. Load of media resource  failed.

(It doesn't tell me which file trigger the warning exactly)

System Info

User agent: 
Mozilla/5.0 (X11; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0

OS:
Distributor ID: Linuxmint
Description:    Linux Mint 21.2
Release:    21.2
Codename:   victoria

Python:
Version 3.10.12

Gradio: 
4.16.0 (fresh install)

Severity

Blocking usage of gradio

Edit: update the screen recorder that was corrupted

arash-aut commented 8 months ago

Hi everyone, I'm facing the same problem. Any help?

JackismyShephard commented 8 months ago

I am having the same problem on firefox in linux as well. Using chrome on windows, I get some clipping instead.

JackismyShephard commented 8 months ago

I am having the same problem on firefox in linux as well. Using chrome on windows, I get some clipping instead.

I don't know if if this is related but I can't play back audio recorded from microphone when using chrome on android.

abidlabs commented 2 weeks ago

Hi, apologies for the late follow up. We haven't had a chance to look into this issue, but the Gradio codebase has changed quite significantly since this issue was created, particularly with the release of Gradio 5. Could you let us know if this is still an issue in the latest version of Gradio (pip install --upgrade gradio)? Thanks!

abidlabs commented 1 week ago

Closing the issue for now, but happy to reopen if the issue continues to persist in the latest version of Gradio