#!/usr/bin/env bash
# run-tool-all.sh: runs the Koldflux Normalize audio tool (live page, headless Chromium via Playwright) on the quiet test files, then checks each download.
# Needs node + playwright (PW=/path/to/playwright/index if not in ~/agent-tools), tool-run.cjs next to this file, and the files made by test-run.sh. Writes tool-results.txt.
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
R=tool-results.txt; : > $R
echo "# KOLDFLUX TOOL (live page $(date +%F)), input in, output MP3 downloaded from the page" | tee -a $R
for b in q35-hiss60 q35-hiss50 q28-hiss50 q22-hiss50; do node "$HERE/tool-run.cjs" in/$b.wav out/$b-tool.mp3 | grep -E "finished" | sed "s/^/$b: /" | tee -a $R; bash "$HERE/check-level.sh" out/$b-tool.mp3 | tee -a $R; done
