Skip to content

Fix temporary audio cleanup after failures - #72

Open
Shubham-Padkonde wants to merge 1 commit into
bbc:masterfrom
Shubham-Padkonde:fix/cleanup-temporary-audio
Open

Shubham-Padkonde wants to merge 1 commit into
bbc:masterfrom
Shubham-Padkonde:fix/cleanup-temporary-audio

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor

Failed audio comparisons leave temporary WAV files behind. find_offset_between_files() only deletes the files after a successful result, so a failure converting the second input, reading a WAV, or analyzing short audio skips cleanup. FFmpeg can also leave a partial output when conversion fails.

Register each successfully converted file for cleanup immediately, using ExitStack, and remove partial output when conversion raises. Existing error messages and returned offset results are preserved.

Four regression cases fail before the fix and pass afterward. They check conversion, reading, and analysis failures, including preserving the original exception and deleting partial FFmpeg output. The full suite passes on Linux with Python 3.12 and real FFmpeg: 11 passed. Black reports both changed files unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant