Only an existing file counts as a completed conversion. Report a blocked path through the per-input failure summary while letting the other conversions finish.
A codec name appearing in a comment packet is not a stream identifier. Read the first Ogg packet for both discovery and trimming so non-Opus files stay out of the conversion queue.
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").
tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ffmpeg reads stdin for key commands. Every ffmpeg call in tools/audio_wav.py
(audio_digest, decode) and make_game.py (decode_xma) inherited the caller's
stdin, so a run started in the background of a terminal stopped at its first
decode ("Stopped (tty output)"), and input piped to the caller was swallowed.
tests/test_audio_wav.py's own ffmpeg fixture calls did the same: in a
`while read` loop over tests/ with ffmpeg on PATH, they ate the next file
names and four test files were silently skipped.
Give every ffmpeg call stdin=subprocess.DEVNULL, and add fake-ffmpeg tests
that check each call reads nothing from stdin: the decode run and the resume
check of audio_wav.py, and make_game.decode_xma().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GQWmXYJ1uVSCTNfvSjPMF7
audio_wav.py previously clamped --jobs below 1 silently to 1 instead of raising a command-line error, allowed main() only without arguments, and did not validate --out when pointing to an existing file before attempting to create directories.
- main(argv=None) now accepts programmatic arguments.
- --jobs < 1 is rejected with ap.error('--jobs must be at least 1').
- --out pointing to an existing file is rejected with ap.error.
- Extracted FakeFfmpegDecodeTest in tests/test_audio_wav.py so fake decode checks run without requiring ffmpeg on PATH.
- Added AudioWavCliTest covering all CLI validation error paths.
Both inputs mapped to x.wav (as did x.ogg and x.OPUS on Windows). Two jobs then decoded into the same
x.wav.part.wav at once, and with --jobs 1 the second replaced the first; either way the summary said
"3 WAV written" while one result was gone. output_names now keeps the extension for inputs that share a stem
(x.ogg.wav, x.opus.wav) and adds ~2, ~3 if a name still clashes. Unique names are unchanged, so WAVs from
earlier runs are still found and skipped.
make_game.py is not affected: it runs this tool on awc_opus.py output, which is all .ogg.
Tests: SameStemTest in tests/test_audio_wav.py, with a fake ffmpeg so it runs without ffmpeg installed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add tools/audio_wav.py (stdlib only): recursive .ogg/.opus discovery, ffmpeg to pcm_s16le, mirrored paths, skip existing, --jobs, clear summary, and a clear error when ffmpeg is missing. It trims to the Ogg Opus end granule (minus pre-skip) so ffmpeg cannot keep a partial final frame. Wire it into make_game.py behind --wav, after the Ogg Opus step, with an ffmpeg preflight. Update README and the awc_opus docstring.