48 lines
1.6 KiB
Bash
Executable File
48 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Fix remaining voice dependency issues
|
|
# Run: bash scripts/fix-voice-deps.sh
|
|
|
|
set -e
|
|
|
|
echo "=== Fixing voice dependencies ==="
|
|
|
|
# 1. Fix whisper-cli — remove broken placeholder and install real binary
|
|
echo "[1/3] Fixing whisper-cli..."
|
|
echo " Building whisper.cpp from source (this takes a few minutes)..."
|
|
sudo apt install -y cmake git build-essential
|
|
|
|
TMPDIR=$(mktemp -d)
|
|
git clone https://github.com/ggml-org/whisper.cpp.git "$TMPDIR/whisper.cpp"
|
|
cd "$TMPDIR/whisper.cpp"
|
|
cmake -B build
|
|
cmake --build build --config Release -j$(nproc)
|
|
sudo cp build/bin/whisper-cli /usr/local/bin/whisper-cli
|
|
cd -
|
|
rm -rf "$TMPDIR"
|
|
|
|
echo " whisper-cli installed: $(whisper-cli --help 2>&1 | head -1)"
|
|
|
|
# 2. Fix piper shared libraries
|
|
echo ""
|
|
echo "[2/3] Installing piper shared libraries..."
|
|
sudo cp /tmp/piper/libespeak-ng.so* /usr/local/lib/
|
|
sudo cp /tmp/piper/libonnxruntime.so* /usr/local/lib/
|
|
sudo cp /tmp/piper/libpiper_phonemize.so* /usr/local/lib/
|
|
sudo cp /tmp/piper/espeak-ng /usr/local/lib/
|
|
sudo cp -r /tmp/piper/espeak-ng-data /usr/local/lib/
|
|
sudo ldconfig
|
|
|
|
echo " Libraries installed and ldconfig run"
|
|
|
|
# 3. Verify piper works
|
|
echo ""
|
|
echo "[3/3] Verifying piper..."
|
|
echo "안녕하세요" | piper --model /usr/local/share/piper-voices/ko_KR-kss-medium.onnx --output_file /tmp/test_piper.wav && \
|
|
echo " Piper TTS OK ($(stat -c%s /tmp/test_piper.wav) bytes)" && \
|
|
rm -f /tmp/test_piper.wav || \
|
|
echo " Piper TTS test failed"
|
|
|
|
echo ""
|
|
echo "=== Done! Verify with: ==="
|
|
echo " whisper-cli --help"
|
|
echo " echo 'hello' | piper --model /usr/local/share/piper-voices/ko_KR-kss-medium.onnx --output_file /tmp/test.wav" |