#!/bin/zsh
# Claude Voice — talk to Claude in real time, hands-free.
# Usage: ./run.sh              (defaults: haiku model, af_heart voice)
#        MODEL=sonnet ./run.sh
cd "$(dirname "$0")"
# build the echo-cancellation mic helper once (needs Xcode CLT)
if [ ! -x helper/aecmic ] && command -v swiftc >/dev/null; then
  echo "building echo-cancellation helper..."
  swiftc -O -o helper/aecmic helper/aecmic.swift -framework AudioToolbox
fi
# fetch the speaker-verification model once (40 MB)
if [ ! -f models/titanet_small.onnx ]; then
  echo "downloading speaker-verification model..."
  curl -sL -o models/titanet_small.onnx https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/nemo_en_titanet_small.onnx
fi
exec .venv/bin/python main.py "$@"
