You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using an output audio block with streaming=True. I call yield audio chunks in my callback function. Audio playback works fine.
But when I try to download the audio, nothing happens. After few mins a zero size file gets downloaded.
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
import gradio as gr
import numpy as np
def build_tts_ui():
with gr.Blocks() as tts_ui:
def generate_sine_tone(numsamples, sample_time, frequency):
t = np.arange(numsamples) * sample_time # Time vector
signal = 32767*np.sin(2*np.pi * frequency*t)
return signal
def text_to_speech():
count = 5
while count:
signal = generate_sine_tone(16000, 1.0/16000, 440).astype(np.int16)
count -= 1
yield (16000, signal)
synthesize_btn = gr.Button("Synthesize")
output_audio = gr.Audio(label="Synthesized Speech", autoplay=True, show_edit_button=False, interactive=False, streaming=True)
flag_btn = gr.Button("Flag")
synthesize_btn.click(text_to_speech, None, [output_audio])
tts_logger_callback = gr.CSVLogger()
tts_logger_callback.setup([output_audio], "flagged/tts")
flag_btn.click(lambda *args: tts_logger_callback.flag(args), [output_audio], None, preprocess=False, postprocess=False)
return tts_ui
demo = build_tts_ui().queue()
demo.launch(server_name="0.0.0.0", server_port=7860)
# demo.launch(server_name="0.0.0.0", server_port=7860, share=False, ssl_certfile="cert/cert.pem", ssl_keyfile="cert/key.pem", ssl_verify=False, show_api=False)
Screenshot
No response
Logs
No activity is seen in the logs
System Info
Python 3.8
Gradio 4.7.1
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered:
Describe the bug
I am using an output audio block with
streaming=True
. I call yield audio chunks in my callback function. Audio playback works fine.But when I try to download the audio, nothing happens. After few mins a zero size file gets downloaded.
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No activity is seen in the logs
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: