#!/usr/bin/env bash # homeai-voice/setup.sh — P3: Voice pipeline (STT / TTS / Wyoming) # # Components: # - Whisper.cpp — speech-to-text (Apple Silicon / CUDA optimised) # - wyoming-faster-whisper — Wyoming STT adapter (port 10300) # - Kokoro TTS — fast text-to-speech via ONNX # - wyoming-kokoro — Wyoming TTS adapter (port 10301) # - Chatterbox TTS — voice cloning (MPS / CUDA) # - openWakeWord — always-on wake word detection # # Prerequisites: # - P1 (homeai-infra) completed — Home Assistant running # - P2 (homeai-llm) completed — Ollama running # - Python 3.10+ installed # - macOS: Xcode Command Line Tools (for whisper.cpp compilation) # - Linux: build-essential, cmake set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" source "${REPO_DIR}/scripts/common.sh" log_section "P3: Voice Pipeline" detect_platform # ─── Prerequisite check ──────────────────────────────────────────────────────── log_info "Checking prerequisites..." prereq_ok=true if ! curl -sf http://localhost:8123 -o /dev/null 2>/dev/null; then log_warn "Home Assistant (P1) not reachable at :8123" prereq_ok=false fi if ! curl -sf http://localhost:11434 -o /dev/null 2>/dev/null; then log_warn "Ollama (P2) not reachable at :11434" prereq_ok=false fi if ! command_exists python3; then log_warn "python3 not found — required for STT/TTS adapters" prereq_ok=false fi if [[ "$prereq_ok" == "false" ]]; then log_warn "Prerequisites not met. Complete P1 and P2 first." fi # ─── TODO: Implementation ────────────────────────────────────────────────────── cat <<'EOF' ┌─────────────────────────────────────────────────────────────────┐ │ P3: homeai-voice — NOT YET IMPLEMENTED │ │ │ │ Implementation steps (see homeai-voice/PLAN.md): │ │ │ │ 1. whisper/install.sh │ │ - Clone + compile whisper.cpp (Metal/CUDA flags) │ │ - Download models: large-v3, medium.en │ │ - Install wyoming-faster-whisper Python package │ │ │ │ 2. tts/install-kokoro.sh │ │ - pip install kokoro-onnx │ │ - Install wyoming-kokoro adapter │ │ │ │ 3. tts/install-chatterbox.sh │ │ - pip install chatterbox-tts │ │ - Verify MPS (macOS) or CUDA (Linux) acceleration │ │ │ │ 4. wyoming/install.sh │ │ - Install wyoming-openwakeword │ │ - Configure wake word: hey_jarvis │ │ │ │ 5. scripts/launchd/ or systemd/ │ │ - wyoming-stt (port 10300) │ │ - wyoming-tts (port 10301) │ │ - wakeword daemon │ │ │ │ 6. wyoming/test-pipeline.sh │ │ - End-to-end smoke test │ │ │ │ Interface contracts: │ │ WYOMING_STT_URL=tcp://localhost:10300 │ │ WYOMING_TTS_URL=tcp://localhost:10301 │ └─────────────────────────────────────────────────────────────────┘ EOF log_info "P3 is not yet implemented. See homeai-voice/PLAN.md for details." exit 0