#!/usr/bin/env bash
|
set -euo pipefail
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
WAV_PATH="${1:-"$ROOT_DIR/testdata/perf/baseline.wav"}"
|
RUNS="${2:-3}"
|
|
if [[ ! -f "$WAV_PATH" ]]; then
|
cat >&2 <<EOF
|
Missing WAV fixture: $WAV_PATH
|
|
Usage:
|
scripts/benchmark-recognition.sh /absolute/path/to/baseline.wav 5
|
|
The WAV must be 16kHz mono PCM16. Keep the same fixture across versions for A/B performance comparison.
|
EOF
|
exit 2
|
fi
|
|
cd "$ROOT_DIR"
|
go run ./cmd/benchmark-recognition --wav "$WAV_PATH" --runs "$RUNS"
|