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
31.97k stars 2.38k forks source link

Audio component does not record for users on iOS #5979

Closed charryshi closed 10 months ago

charryshi commented 10 months ago

Describe the bug

In my case, the recorded audio is silent. That is to say, if I record for 5 seconds, I will get a player with 5 seconds of recorded audio. But when I play it, I will hear nothing.

I tested record/playback on another site (https://addpipe.com/simple-web-audio-recorder-demo/), and there it works.

Version: gradio-3.41.0 iOS Version:16.7 tested in safari and chrome, both not working.

using code from https://www.gradio.app/guides/real-time-speech-recognition

import gradio as gr from transformers import pipeline import numpy as np

transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")

def transcribe(audio): sr, y = audio y = y.astype(np.float32) y /= np.max(np.abs(y))

return transcriber({"sampling_rate": sr, "raw": y})["text"]

demo = gr.Interface( transcribe, gr.Audio(source="microphone"), "text", )

demo.launch()

Have you searched existing issues? πŸ”Ž

Reproduction

using the test code, click"record from micphone" and "stop recording", play it, will hear nothing

Screenshot

No response

Logs

No response

System Info

Version: gradio-3.41.0
iOS Version:16.7
tested in safari and chrome, both not working.

Severity

Blocking usage of gradio

charryshi commented 10 months ago

Ok,I solved this problem. Upgrade ffmpeg to version 5.1.3

abidlabs commented 10 months ago

Thanks for letting us know the solution @charryshi!