# YakYak Package in PyPi.org, Synthetic Voice Free and Easy

**URL:** <https://makermattdesign.com/t/yakyak-package-in-pypi-org-synthetic-voice-free-and-easy/56>\
**Category:** yakyak\
**Tags:** yakyak-reports\
**Created:** [March 16, 2024, 2:07am UTC](https://makermattdesign.com/t/yakyak-package-in-pypi-org-synthetic-voice-free-and-easy/56 "2024-03-16T02:07:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt](https://makermattdesign.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@Matt](https://makermattdesign.com/u/Matt)\
**Post date:** [March 16, 2024, 2:07am UTC](https://makermattdesign.com/t/yakyak-package-in-pypi-org-synthetic-voice-free-and-easy/56/1 "2024-03-16T02:07:40Z")

</div>

# YakYak

YakYak is a utility for the generation of synthetic voice through use of [Wyoming-Piper](https://github.com/rhasspy/wyoming-piper).

YakYak can be used from the command line or called from python. It opens a TCP socket to Wyoming-Piper running in Docker anywhere on your local area network. It scales to run efficiently on large multi-core computers or small single board computers.

## Install YakYak

To install YakYak, python virtual environment is recommended.

Create a python virtual environment and activate it

> cd some\_directory  
> sudo apt install python3.12-venv  
> python3 -m venv .venv  
> source .venv/bin/activate

Install the yakyak package and dependencies

```bash
pip install yakyak
wget https://raw.githubusercontent.com/b202i/yakyak/refs/heads/master/requirements.txt
pip install -r requirements.txt

```

Setup wyoming-piper in docker, on your local area network.

```bash
wget https://raw.githubusercontent.com/b202i/yakyak/refs/heads/master/docker-compose.yml
docker compose up -d

```

Install ffmpeg for mac

```bash
> brew install ffmpeg

```

Install ffmpeg for ubuntu

```bash
sudo apt install ffmpeg

```

Test YakYak, Wyoming-Piper and FFMPEG installation

It will take a little longer the first time running YakYak, the Wyoming-Piper app needs time to download voice files.

```bash
yakyak --host localhost -t mp3

```

Observe successful test results:

```plaintext
INFO:root:Server localhost:10200 is online
INFO:root:Success, test: mp3

```

## How to use YakYak from the command line

As with many Linux applications, YakYak supports standard in, and standard out. It also supports file input with the -i command and -o for file output. For a complete set of commands type yakyak --help.

> yakyak --help

Create an mp3 file with “Hello world”

```bash
> echo Hello world | yakyak -f mp3 -o hello_world.mp3

```

If you are on Linux and have aplay installed, you can do this:

```bash
echo Hello world | yakyak | aplay

```

This assumes that Docker is running on the same machine. If Docker is running on a different machine on your network, you can do this:

```bash
> echo Hello world | yakyak --host a_different_machine.local | aplay

```

## How to use YakYak from Python

Create the file `test_yakyak.py` with the following content:

```python
from yakyak import is_server_online, piper_tts_server

print(f"{is_server_online(
        'localhost', 
        10200, 
        )=}")

print(f"{piper_tts_server(
        'localhost', 
        10200, 
        'Hello World',
        'hello_world.mp3',
        'mp3',
        'en_US-amy-medium'
        )=}")

```

```bash
python3 test_yakyak.py  

```

Observe that the server is online and a file hello\_world.mp3 is created. Play the mp3 and you will hear “Hello world”.
