feat: AutoPlay – hands-free radio station mode for continuous music generation#1160
Open
feat: AutoPlay – hands-free radio station mode for continuous music generation#1160
Conversation
- Add autoplay_checkbox to the results section navigation row (result.py) - Add elem_id 'acestep-next-batch-btn' to the Next Batch button - Create autoplay.js: monitors audio 'ended' events, auto-clicks Next Batch when audio finishes (polls until enabled when AutoGen is generating), then auto-plays first slot when new audio loads; persists checkbox to localStorage - Create autoplay.py: Python loader for the autoplay.js head script - Inject autoplay JS into Gradio head in __init__.py - Add i18n keys results.autoplay_label/autoplay_info to all 5 language files Agent-Logs-Url: https://github.com/ace-step/ACE-Step-1.5/sessions/006413d6-3dff-4288-9443-64ee9e0f376c Co-authored-by: ChuxiJ <[email protected]>
- Add comment explaining the 3-minute MAX_POLL_MS timeout rationale
- Remove expensive querySelectorAll('*') shadow-root scan; Gradio renders
audio elements in the main document tree so flat querySelectorAll suffices
- Limit MutationObserver to .gradio-container (falls back to documentElement)
to reduce observer scope; add comment explaining rAF debounce rationale
Agent-Logs-Url: https://github.com/ace-step/ACE-Step-1.5/sessions/006413d6-3dff-4288-9443-64ee9e0f376c
Co-authored-by: ChuxiJ <[email protected]>
Copilot
AI
changed the title
[WIP] Add AutoPlay checkbox for AutoGen functionality
feat: AutoPlay – hands-free radio station mode for continuous music generation
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users had to manually click "Next Batch" and "Play" after every generated batch, breaking the continuous listening experience. AutoPlay eliminates both clicks by wiring audio
endedevents to automatic batch navigation and playback.Changes
UI (
result.py)🔁 AutoPlaycheckbox to the batch navigation row (elem_id="acestep-autoplay")elem_id="acestep-next-batch-btn"to the Next Batch button so JS can click itClient-side logic (
autoplay.js+autoplay.py)New self-contained JS module injected via
gr.Blocks(head=…):endedlisteners on all audio players; when AutoPlay is checked and audio ends, clicks Next Batch immediately if enabledpendingAutoPlay = trueonly when autoplay triggers navigation (not manual clicks), soloadedmetadataon the first new audio slot auto-starts playbacklocalStorageand restores it on page load via DOM polling.gradio-containerwithrequestAnimationFramedebounce to avoid per-render overhead; 3-minute poll timeout cleans up on generation failurei18n
Added
results.autoplay_label/results.autoplay_infoto all five language files (en,zh,ja,he,pt).Behaviour summary
localStorage