Repository navigation
fix(gui): Stop also stops audio that is still playing - #24
Merged
Merged
Conversation
Stop only cancelled synthesis. Once every chunk was ready, pressing it in background mode let playback run to the end, and in window mode the button greyed out while the mpv window kept playing. - wait_until_released(cancel_event=) returns as soon as Stop is pressed; smart_generate_long_text then raises GenerationCancelled, which stops the player. - A GUI player window stays registered after its worker ends, until it is closed or stopped (running(), any_streaming_player_running()). The GUI keeps Stop enabled while it is open, and Stop closes it. - start() registers the player before starting its worker, so a worker that ends at once can no longer leave a stale registration. - Status shows "Playing…" once every chunk is ready, and "Stopped." after a stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The GUI's Stop button only cancelled synthesis.
Changes
StreamingAudioPlayer.wait_until_released(cancel_event=)returns as soon as the event is set.smart_generate_long_textthen raisesGenerationCancelled, which stops the player, so cancelling cuts playback short, not only synthesis.running(),any_streaming_player_running()). The GUI keeps Stop enabled while the window is open ("Playing in the player window. Stop closes it."), and Stop closes it. Stopping runs off the Tk thread.start()registers the player before starting its worker. A worker that ended at once used to unregister first and leave a stale entry; a new test caught it.Testing
GenerationCancelledand removing the run dir, and the GUI Stop / window-watch flow.🤖 Generated with Claude Code