Repository navigation
Interactive trim prompt and clean Ctrl+C exit on Windows - #2
Merged
Merged
Conversation
After the loop is chosen, export commands ask whether to trim WAV, FLAC and Ogg Vorbis files after the loop end, and how many samples to keep (100 by default). With tag, a single tagged and trimmed copy is written.
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.
Summary
tag,split-audio,extend,export-points) ask whether to losslessly trim the file after the loop end, and how many samples to keep (Enter = 100). The prompt only appears for formats that support lossless trimming (PCM/float WAV, FLAC, Ogg Vorbis), and not fortrimitself.tag, a single copy is written that is both tagged and trimmed (name-tagged.ext), instead of separate tagged and trimmed files.MusicLooper.supports_lossless_trim()andtrim/keep_afteroptions toMusicLooper.export_tags().input()prompt can surface asEOFError, with the real interrupt arriving moments later. This printed an emptyERRORline followed by aKeyboardInterrupttraceback from sounddevice's PortAudio cleanup at exit. Both are now handled, and further Ctrl+C is ignored while exiting.Testing
uv run pytest: 105 passed, including new tests for the trim prompt (answers, invalid input, interrupts), the combined tag + trim output for FLAC and Ogg Vorbis, format support detection, and prompt skipping for unsupported formats and thetrimcommand.pymusiclooper -s -i tag ... --tag-names LOOPSTART LOOPLENGTHend to end on a generated WAV: one tagged file was written, cut at the expected sample.