JavaScript is required to view this page.
Skip to content
Home Assistant Voice Bundle Deals!
Home Assistant Voice Bundle Deals!

Using Voice Accelerator Bundle

Wyoming Satellite Installation Guide for Voice Processing Acceleration

Wyoming Satellite Installation Guide for Voice Processing Acceleration

Install Prerequisites:

  • Update package lists:
    sudo apt-get update
  • Install necessary software:
    sudo apt-get install --no-install-recommends git python3-venv

Download Wyoming Assist:

git clone https://github.com/rhasspy/wyoming-satellite.git
cd wyoming-satellite/

Create Python Virtual Environment & Install Prerequisites:

python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -f 'https://synesthesiam.github.io/prebuilt-apps/' -r requirements.txt -r requirements_audio_enhancement.txt -r requirements_vad.txt

Verify Installation:

script/run --help

Audio Device Setup & Testing:

  • Verify Audio Devices:
    arecord -L
  • Record Test Audio:
    arecord -D plughw:CARD=seeed2micvoicec,DEV=0 -r 16000 -c 1 -f S16_LE -t wav -d 5 test.wav
  • List Available Speakers:
    aplay -L
  • Playback Test Audio:
    aplay -D plughw:CARD=seeed2micvoicec,DEV=0 test.wav

Run Wyoming Satellite with Components:

Run Wyoming Satellite:

script/run \
  --debug \
  --name 'my satellite' \
  --uri 'tcp://0.0.0.0:10700' \
  --mic-command 'arecord -D plughw:CARD=seeed2micvoicec,DEV=0 -r 16000 -c 1 -f S16_LE -t raw' \
  --snd-command 'aplay -D plughw:CARD=seeed2micvoicec,DEV=0 -r 22050 -c 1 -f S16_LE -t raw'

Change CARD to your Mic and Speaker.

Run Wyoming Satellite as a Service:

Create Service:

sudo systemctl edit --force --full wyoming-satellite.service

Service Configuration:

[Unit]
Description=Wyoming Satellite
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
ExecStart=/home/pi/wyoming-satellite/script/run --name 'my satellite' --uri 'tcp://0.0.0.0:10700' --mic-command 'arecord -D plughw:CARD=seeed2micvoicec,DEV=0 -r 16000 -c 1 -f S16_LE -t raw' --snd-command 'aplay -D plughw:CARD=seeed2micvoicec,DEV=0 -r 22050 -c 1 -f S16_LE -t raw'
WorkingDirectory=/home/pi/wyoming-satellite
Restart=always
RestartSec=1

[Install]
WantedBy=default.target

Change your working directory tou yours /home/yourserver

Enable and Start the Service:

sudo systemctl enable --now wyoming-satellite.service

Using Home Assistant Voice Instead of Local Mic/Speaker:

If you want to use Home Assistant Voice instead of a microphone and speaker directly connected to your H4/H4 Ultra, you will need to:

  1. Run Whisper and Piper on Linux:
    • Install Whisper for speech-to-text and Piper for text-to-speech on your Linux system.
  2. Configure in Home Assistant:
    • Use the "Add Service" feature in Home Assistant.
    • Configure it to use the IP of your H4/H4 Ultra and the correct port to offload the voice processing (Piper and Whisper) to the H4.

This setup allows for centralized voice processing, potentially improving performance and reducing latency.

 

Install Piper and Whisper on Linux Mint

Install Piper and Whisper on Linux Mint

Installing Piper

  1. Install Dependencies:
    sudo apt update
    sudo apt install -y python3 python3-pip libsndfile1
  2. Install Piper:
    pip install piper-tts
  3. Download Piper Models: Run the following commands:
    mkdir -p ~/piper_models
    cd ~/piper_models
    wget https://github.com/rhasspy/piper/releases/download/v0.0.2/en-us-amy-low.onnx
    wget https://github.com/rhasspy/piper/releases/download/v0.0.2/en-us-amy-low.json
  4. Run Piper Server:
    piper --model ~/piper_models/en-us-amy-low.onnx --config ~/piper_models/en-us-amy-low.json --server
    By default, this runs on http://0.0.0.0:5002.

Installing Whisper

  1. Install Dependencies:
    sudo apt update
    sudo apt install -y python3 python3-pip
    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
  2. Install Whisper:
    pip install whisper
  3. Run Whisper Service: Create a Python script named whisper_server.py with the following content:
    from flask import Flask, request, jsonify
    import whisper
    
    app = Flask(__name__)
    model = whisper.load_model("base")
    
    @app.route("/transcribe", methods=["POST"])
    def transcribe():
        audio_file = request.files['file']
        result = model.transcribe(audio_file)
        return jsonify(result)
    
    if __name__ == "__main__":
        app.run(host="0.0.0.0", port=5003)
    Save the file and run it:
    python3 whisper_server.py
    This runs Whisper on http://0.0.0.0:5003.

Using in Home Assistant

  1. Piper Integration: Add the following configuration to Home Assistant:
    tts:
      - platform: rest
        resource: http://<PIPER_DEVICE_IP>:5002/api/tts
        method: POST_JSON
        content_type: "application/json"
        payload:
          text: "{{ message }}"
  2. Whisper Integration: Send audio files to http://<WHISPER_DEVICE_IP>:5003/transcribe using a custom automation or script.

Optional: Run Services as Background Processes

To ensure Piper and Whisper run continuously:

  1. Create systemd service files for Piper and Whisper (/etc/systemd/system/piper.service and /etc/systemd/system/whisper.service).
  2. Enable and start the services:
    sudo systemctl enable piper
    sudo systemctl start piper
    sudo systemctl enable whisper
    sudo systemctl start whisper

If you’ve set up Piper and Whisper on your Linux Mint device with the correct IP and port:

  1. For Piper:

    • Use the IP of your Linux Mint device.
    • Use the port that Piper is running on (e.g., 10200, 5002, or whatever you configured when starting Piper with --server).
  2. For Whisper:

    • Use the same IP as the Linux Mint device.
    • Use the port you configured for the Whisper server (e.g., 10300, 5003, or any other port in your Flask app setup).

In the Wyoming Protocol configuration in Home Assistant:

  • Host: Enter the IP address of your Linux Mint device.
  • Port: Enter the respective port for either Piper or Whisper.

Notes:

  • Ensure that the ports you use (e.g., 10200, 10300) are open and accessible from the Home Assistant device.
  • If your Linux Mint device is behind a firewall, configure it to allow traffic on the chosen ports.
  • Test the connection by accessing http://<IP>:<PORT> from another device (e.g., a browser) to confirm that the services are running.

To ensure Piper and Whisper run continuously:

    Previous article Offload Piper and Whisper from your Home Assistant!
    Next article Enhancing Home Assistant Voice with Dedicated Hardware

    Leave a comment

    Comments must be approved before appearing

    * Required fields

    x