Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible Audio component #10257

Open
1 task done
Oo121oO opened this issue Dec 27, 2024 · 0 comments
Open
1 task done

Incompatible Audio component #10257

Oo121oO opened this issue Dec 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Oo121oO
Copy link

Oo121oO commented Dec 27, 2024

Describe the bug

image

I deploy the Audio Component Demo on AUTODL cloud platform, but I found the audio output doesn't work. and there is no error, click play button nothing happened, click download route to 400 bad request.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import numpy as np
import gradio as gr

notes = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]

def generate_tone(note, octave, duration):
    sr = 48000
    a4_freq, tones_from_a4 = 440, 12 * (octave - 4) + (note - 9)
    frequency = a4_freq * 2 ** (tones_from_a4 / 12)
    duration = int(duration)
    audio = np.linspace(0, duration, duration * sr)
    audio = (20000 * np.sin(audio * (2 * np.pi * frequency))).astype(np.int16)
    return sr, audio

demo = gr.Interface(
    generate_tone,
    [
        gr.Dropdown(notes, type="index"),
        gr.Slider(4, 6, step=1),
        gr.Textbox(value="1", label="Duration in seconds"),
    ],
    gr.Audio(label="output"),
)

if __name__ == "__main__":
    demo.launch(server_port=6006)

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.44.1
gradio_client version: 1.3.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.7.0
fastapi: 0.115.6
ffmpy: 0.5.0
gradio-client==1.3.0 is not installed.
httpx: 0.28.1
huggingface-hub: 0.26.5
importlib-resources: 6.4.5
jinja2: 3.1.5
markupsafe: 2.1.5
matplotlib: 3.7.5
numpy: 1.26.4
orjson: 3.10.12
packaging: 24.2
pandas: 2.2.3
pillow: 10.4.0
pydantic: 2.10.4
pydub: 0.25.1
python-multipart: 0.0.20
pyyaml: 6.0.2
ruff: 0.8.4
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.15.1
typing-extensions: 4.12.2
urllib3: 2.3.0
uvicorn: 0.34.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.2.0
httpx: 0.28.1
huggingface-hub: 0.26.5
packaging: 24.2
typing-extensions: 4.12.2
websockets: 11.0.3

Severity

Blocking usage of gradio

@Oo121oO Oo121oO added the bug Something isn't working label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant