Comments (2)
Hi @rajat19g you'll need to return the updated value of the gr.State
component from your function. This works for me:
import gradio as gr
import time
with gr.Blocks() as demo:
speaker_idx = gr.State(0)
files = ["cantina.wav", "audio.mp3", "cantina.wav"]
render_audio_component = gr.Audio(label="speaking", autoplay=True, value = "cantina.wav")
def continue_audio(speaker_idx):
speaker_idx +=1
time.sleep(0.5)
return speaker_idx, files[speaker_idx]
render_audio_component.stop(continue_audio,inputs = speaker_idx,outputs=[speaker_idx, render_audio_component])
demo.launch()
from gradio.
Thanks a lot @abidlabs. It worked.
from gradio.
Related Issues (20)
- The gr.JSON requires the lines parameter. HOT 2
- Error while following custom component tutorial. HOT 7
- Display number of tokens per second with ChatInference HOT 1
- Run Gradio behind Nginx and FastAPI cause loading page problem
- Pass gr.Request if type hint is `Request | None` HOT 4
- gradio==4.40.0 is not compatible with pydantic==2.5.0 HOT 5
- Deprecate (but do not remove) the `type="tuples"` in `gr.Chatbot` and `gr.ChatInterface`
- Guide 05_chatbots is inconsistent about whether it calls `demo.queue()` HOT 2
- Unable to save a file HOT 1
- Consolidate full-screen functionality across chatbot and image/gallery components
- Interface() show_progress doesn't work
- #8906 still not solve audio play out high delay
- Cannot separate State between users for public spaces accessing private spaces HOT 1
- Mermaid support in markdown for chatbot HOT 1
- "Use via API" with Bash returns an incorrect file download path HOT 2
- Enhancements to tool use in `gr.Chatbot` HOT 6
- gr.ImageEditor color picker is not working HOT 1
- `gr.Plot` is resized indefinitely when using a custom CSS HOT 1
- error 404: Session not found when configured with two upstream servers in nginx configuration HOT 4
- gradio cc build returns 0 even if frontend build is unsuccessful HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradio.