Prerequisites

Make sure you have Docker and Docker Compose installed on your system.

# docker compose version
Docker Compose version v2.29.7

 

Step 1: Create a Docker Compose File

/data/localvoice/docker-compose.yml

Create a file on the guest system named docker-compose.yml and fill it with the following content:

version: "3"
services:
  wyoming-piper:
    container_name: piper 
    image: rhasspy/wyoming-piper
    ports:
      - "10200:10200"
    volumes:
      - "/t/path/to/local/data:/data"
    command: [ "--voice", "en_US-lessac-medium" ]
    restart: unless-stopped

Step 2: Start the Container

Run a server that anyone can connect to:

cd /data/localvoice/
docker compose up

or

docker compose up -d

output

docker compose up
WARN[0000] /data/localvoice/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 2/2
 ✔ Network localvoice_default            Created                                                                0.8s 
 ✔ Container localvoice-wyoming-piper-1  Created                                                                1.1s 
Attaching to wyoming-piper-1

 

Step 3:Adding Wyoming piper to Home Assistant

Integrate Wyoming piper with Home Assistant

Add a new Wyoming Protocol:piper integration in our Home Assistant settings.

This can be done under: Settings > Devices & Services > Add Integration

Go to your Home Assistant settings, go to “Settings > Devices & Services > Add Integration” and add a new “piper” integration. Insert the IP address and corresponding port.

output

tts.piper

Step 4: Test

http://192.168.2.50:10200/

 

data:
  message: Testing one two three four
  language: en_US
  options:
    voice: en_US-lessac-medium
  media_player_entity_id: media_player.xiao_ai_yin_xiang_6318
  cache: true
action: tts.speak
target:
  entity_id: tts.piper

 

Debug containers

docker ps

docker logs <id>

docker logs 7e848412ef45

 

 

Useful links

https://github.com/rhasspy/wyoming-piper

https://exitcode0.net/posts/wyoming-piper-docker-compose/

https://www.matterxiaomi.com/boards/topic/33174/part-1-local-voice-using-docker-compose

Comments

Be the first to post a comment

Post a comment