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 having the same goal as i #3299 to make stream audio works. This could be from remote server or from several local wav files (when first is processed second is generated).
def transcribe(audio)
flist = ['33056526426.wav', '65074181139.wav']
for i in range(2):
if i > 0:
time.sleep(2)
yield flist[i]
Not working and hangs UI thread during sleep. With single file works properly.
Example from this one #1775 is also looks like not working properly gradio/demo/stream_audio/run.py. or doesn't looks like supports real time playback, it is not clear how to stream audio when microphone is not triggering add_to_stream, and how to trigger output audio stream update from some background thread that is making processing. It would be so nice to have some working example .
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
def transcribe(audio)
flist = ['33056526426.wav', '65074181139.wav']
for i in range(2):
if i > 0:
time.sleep(2)
yield flist[i]
2)```
import gradio as gr
import numpy as np
import time
def add_to_stream(audio, instream):
time.sleep(1)
if audio is None:
return gr.update(), instream
if instream is None:
ret = audio
else:
ret = (audio[0], np.concatenate((instream[1], audio[1])))
return ret, ret
with gr.Blocks() as demo:
inp = gr.Audio(source="microphone")
out = gr.Audio()
stream = gr.State()
clear = gr.Button("Clear")
inp.stream(add_to_stream, [inp, stream], [out, stream])
clear.click(lambda: [None, None, None], None, [inp, out, stream])
if __name__ == "__main__":
demo.launch()
Screenshot
No response
Logs
No response
System Info
any
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered:
Describe the bug
I am having the same goal as i #3299 to make stream audio works. This could be from remote server or from several local wav files (when first is processed second is generated).
I have checked this solution: yield-ing the output audio file to an Audio output component. it is not working properly,
Not working and hangs UI thread during sleep. With single file works properly.
Example from this one #1775 is also looks like not working properly gradio/demo/stream_audio/run.py. or doesn't looks like supports real time playback, it is not clear how to stream audio when microphone is not triggering add_to_stream, and how to trigger output audio stream update from some background thread that is making processing. It would be so nice to have some working example .
Have you searched existing issues? 🔎
Reproduction
def transcribe(audio)
flist = ['33056526426.wav', '65074181139.wav']
for i in range(2):
if i > 0:
time.sleep(2)
yield flist[i]
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: