Skip to content

CLI: give each input its own output name; report audio errors clearly - #17

Merged
CodeWithBehnam merged 1 commit into
mainfrom
claude/lucid-franklin-gsu7v4
Sep 30, 2026
Merged

CodeWithBehnam merged 1 commit into
mainfrom
claude/lucid-franklin-gsu7v4

Conversation

@CodeWithBehnam

Copy link
Copy Markdown
Owner

What does this PR do?

Closes #7.

  • Output names: 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). Two cases are rejected before any work starts: --output-name with several inputs, and inputs that share a stem (e.g. day1/talk.mp3 day2/talk.mp3).
  • stdin: stdin is now read inside the per-file error handling. Errors report the input path, not the decoded array.
  • load_audio errors: a missing file raises FileNotFoundError. A missing ffmpeg, or ffmpeg failing to decode, raises the new AudioLoadError (a RuntimeError, so existing except RuntimeError still works). The CLI's old FileNotFoundError/CalledProcessError handlers never fired, and a missing ffmpeg was reported as "File not found: ".
  • Early check: 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.

Behaviour change: load_audio used to raise ValueError for a missing file; it now raises FileNotFoundError.

How was this tested?

  • Tested with audio file(s)
  • Ran existing tests (pytest): 44 passed, 1 skipped (the ffmpeg-decoding test skips without ffmpeg; it passed locally with an ffmpeg binary)
  • Tested CLI (vayu audio.mp3): tests/test_cli.py drives cli.main() with stubbed transcription

tests/test_cli.py has 11 tests. Eight fail on main.

claude-review will fail as on #12 (the repository's CLAUDE_CODE_OAUTH_TOKEN secret, see this comment).

🤖 Generated with Claude Code

https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA


Generated by Claude Code

- 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
@CodeWithBehnam
CodeWithBehnam merged commit 5fbc174 into main Sep 30, 2026
3 of 4 checks passed
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.

CLI: multiple input files overwrite each other's output; audio errors mis-reported

2 participants