Read Text Extension and Larynx

Before Read Text will work, make sure that the larynx-server is working by browsing to http://0.0.0.0:5002

Read Text Extension 0.8.72 uses Piper to replace Larynx, because the owner archived the Larynx GitHub repository on Jun 21, 2023 and Larynx contributors can no longer update Larynx code. You could also use another locally hosted speech server like Mycroft Mimic3 at http://localhost:59125/ in place of larynx-server. To use a local speech server with Read Text Extension, select an option in the main dialog that includes the text "(NETWORK_READ_TEXT_PY)".

Read Text Extension 0.8.62 supports Larynx speech synthesis on supported platforms if the larynx-server program is running. With You can tell if Larynx is running by opening a web browser to http://localhost:5002/ and verifying that the web app can read the main text box field aloud. Since the larynx-server Application Programming Interface (API) uses the http network protocol, supported snap and flatpak versions of office software that block speech-dispatcher can now use high quality speech synthesis with Read Text Extension. On Debian 11.5 compatible Linux platforms, you can use cinnamon-settings startup, gnome-session-properties or another similar application to set up larynx-server to automatically start up after 10-15 seconds when you log in. For testing purposes, you can also start the server by entering the larynx-server command in a terminal window.  To use the Larynx speech server with Read Text Extension, select an option in the main dialog that includes the text "(NETWORK_READ_TEXT_PY)".

Larynx

Larynx is a speech synthesis tool from the Rhasspy project. You can use Rhasspy tools for home automation by connecting computers to various sensors, actuators, and other devices. This allows the computers to control lights, temperature, security systems, and more from a single device. For example, a Rhasspy project could sense that a garage door has been open for 20 minutes, and then ask you if you want to shut it. It would then listen for a “Yes” or “No” response and act according to the response. Larynx and other Rhasspy tools might not run on some computers because they are designed to run using processors that are capable of handling complex tasks quickly and reliably. For Linux distributions that cannot use the Debian larynx apt package, the author offers the package as a Docker application or a python3-pip package.

Apt

The author of Larynx distributes the package as an apt package for Debian Linux 11.5. Apt is a package management system for Linux that includes a large repository of packages. It resolves dependencies automatically and makes it easy to install and remove packages. Apt is able to easily keep packages up-to-date. You cannot use apt package management on Fedora Linux because it uses a different package manager called dnf.

Example

sudo apt-get install ./larynx-tts_1.1.0_amd64.deb

Docker

You can use Docker for a variety of tasks, such as creating and deploying your own applications, testing out new software, running multiple isolated applications on the same system, or running a web server. There are a few potential risks associated with using Docker, such as malicious images or containers, security vulnerabilities, and data loss. You can reduce the risks of using Docker by ensuring that all images and containers are from trusted sources, regularly updating the system and installed applications, using secure authentication methods, and monitoring system logs for suspicious activity. You can find out about Docker by reading tutorials and guides online. There are many helpful resources available on the official Docker website. Docker supports several distributions of Linux.

Ubuntu 22.04 LTS

This Docker installation code is based on code listed on  the Chris Titus blog.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install docker-ce -y
sudo usermod -aG docker ${USER}

Reboot your computer. 

If your policies allow it, you can enable docker to automatically start running as a daemon when turn on the computer. Users in the “docker” group can install software that can read and write to their directory. Users who are not in the “docker” group can use some docker images with limited permissions.

See also "Install Using the Repository" from the Docker documents site. Consider installing a Docker manager like Portainer.

Follow the instructions on the Larynx main page to install larynx-server.

Fedora 37.17

The Fedora Developer and the Docker websites are the best source for up-to-date information on how to install Docker and configure it for local users. These commands worked in December, 2022.

sudo dnf install dnf-plugins-core
dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io
sudo newgrp docker
sudo groupadd docker && sudo gpasswd -a ${USER} docker && sudo systemctl restart docker

Reboot your computer.

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

Follow the instructions on the Larynx main page to install larynx-server.

Test larynx-server by running the larynx-server command from a terminal window and opening your web browser to the settings page at http://localhost:5002/. If the startup parameters of your Linux desktop allow it, then you can use the following command to set the server to automatically start up when you log in.

echo "[Desktop Entry]\

Version=1.0\

Name=Larynx\

GenericName=Larynx\

Comment=Larynx-server http://localhost:5002\

Exec=larynx-server\

Icon=session-properties\

Terminal=true\

Type=Application\

StartupNotify=true\

Categories=Network\

X-Desktop-File-Install-Version=0.26" > ~/.config/autostart/larynx.desktop && \

chmod +755 ~/.config/autostart/larynx.desktop

If the startup parameters of your Linux desktop do not allow automatically starting a container using a desktop file, use Portainer or another graphical user interface to set the restart policy.

Portainer

Optionally add a Docker manager that uses a graphical interface. Portainer is one such manager.

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
    portainer/portainer-ce:latest

The first time you log in to Portainer at https://localhost:9443 the browser might warn you that it does not recognize the self-signed site certificate. If you go on, you create a user name and password for portainer. You will see a list of currently installed Docker images by clicking "Images" in the navigation list. By selecting an image, you can remove it, export it, or build a new image.

If you are happy with always running the Larynx container in the background, you can set the container policy to always start in the background. From the containers list page <https://localhost:9443/#!/2/docker/containers> page, Under the Name heading, click the link for the speech engine. image. Scroll down the page to RESTART POLICIES. and choose Always. Click the Update button to set the policy. Test it by restarting your computer or logging out of your account then logging back in.

Python 3 pip

Use python3-pip if you want to use larynx on your local account without allowing other users access to Docker or larynx.

sudo apt-get install python3-pip
pip3 install larynx

Debian 11.50 and similar

Follow the instructions on the Larynx main page to install larynx-server.

Ubuntu 22.04

If you experience an error using Ubuntu 22.04, try replacing the pip version of jinja2 with the Ubuntu 22.04 default version of jinja2:

sudo apt-get install python3-jinja2

Remove the pip3 version of jinja2 using:

pip3 uninstall Jinja2

See also: <https://github.com/pallets/quart/issues/143>