CLI: give each input its own output name; report audio errors clearly - #17
Merged
Merged
Conversation
- The output name was kept from the first input, so `vayu a.mp3 b.mp3`
wrote both transcripts to a.*. Each input now uses its own stem
("content" for stdin). --output-name with several inputs, or inputs
that share a stem, are rejected before any work starts.
- stdin is read inside the per-file error handling, and errors report
the input path rather than the decoded array.
- load_audio raises FileNotFoundError for a missing file and the new
AudioLoadError (a RuntimeError) when ffmpeg is missing or cannot
decode the input. The CLI's FileNotFoundError/CalledProcessError
handlers never fired before; a missing ffmpeg was reported as
"File not found: <audio>".
- transcribe() checks the audio path exists before loading the model,
so a typo no longer triggers a model download first.
AudioLoadError is exported from the package.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA
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.
What does this PR do?
Closes #7.
vayu a.mp3 b.mp3wrote both transcripts toa.*. Each input now uses its own stem (contentfor stdin). Two cases are rejected before any work starts:--output-namewith several inputs, and inputs that share a stem (e.g.day1/talk.mp3 day2/talk.mp3).load_audioerrors: a missing file raisesFileNotFoundError. A missing ffmpeg, or ffmpeg failing to decode, raises the newAudioLoadError(aRuntimeError, so existingexcept RuntimeErrorstill works). The CLI's oldFileNotFoundError/CalledProcessErrorhandlers never fired, and a missing ffmpeg was reported as "File not found: ".transcribe()checks the audio path exists before loading the model, so a typo no longer triggers a model download first.AudioLoadErroris exported from the package.Behaviour change:
load_audioused to raiseValueErrorfor a missing file; it now raisesFileNotFoundError.How was this tested?
pytest): 44 passed, 1 skipped (the ffmpeg-decoding test skips without ffmpeg; it passed locally with an ffmpeg binary)vayu audio.mp3):tests/test_cli.pydrivescli.main()with stubbed transcriptiontests/test_cli.pyhas 11 tests. Eight fail onmain.claude-reviewwill fail as on #12 (the repository'sCLAUDE_CODE_OAUTH_TOKENsecret, see this comment).🤖 Generated with Claude Code
https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA
Generated by Claude Code