TextToSpeech for HomeAssistant [docker] using local soundcard

Install Music Player Daemon [MPD] on your host.

It will open a port for HA to connect to:

sudo apt install mpd

Check card and device number:

sudo apt install alsa-utils
aplay -l

For example:

card 1: Generic [HD-Audio Generic], device 0: ALC255 Analog [ALC255 Analog]

gives us card 1 and device 0.

Update config file

sudo vim /etc/mpd.conf

add below entry, changing card and device numbers.

Restart MPD

sudo systemctl restart mpd

Add MPD integration in HA.

Host:

localhost

Port:

6600

Test using Media > Text To Speech > Google Translate. Be sure to change the chosen media player device at the bottom.