# YakYak
YakYak is a utility for the local generation of synthetic voice through use of Wyoming-Piper. It 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, Docker Compose & FFMPEG
To install YakYak, a python virtual environment is recommended.
### Step 1, create a python virtual environment and activate it
```bash
cd some_directory
sudo apt install python3.8-venv
python3 -m venv .venv
source .venv/bin/activate
```
### Step 2, install the YakYak package
```bash
pip install yakyak
```
### Step 3, Install ffmpeg
Install ffmpeg for mac
```bash
brew install ffmpeg
```
Install ffmpeg for Ubuntu
```bash
sudo apt install ffmpeg
```
### Setup wyoming-piper in docker, on your local area network.
If you don't already have docker, or better yet docker-desktop, you can download and install it from [docker.com](https://docker.com).
If you don't already have a wyoming-piper __docker-compose.yml__ file, create one using YakYak. Warning, this will overwrite an existing docker-compose.yml file.
```bash
yakyak --docker > docker-compose.yml
```
Now you can start wyoming-piper in a docker container
```bash
docker compose up -d --force-recreate
```
## Test installation
It will take a little longer the first time running YakYak,
the Wyoming-Piper app needs time to download voice files.
```bash
piper -h localhost -t mp3
```
Observe successful test results
```text
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.
```bash
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'
)=}")
```
Now test it
```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".
```text
run.py
check_ffmpeg_version()='ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers'
is_server_online(
'localhost',
10200,
)=True
INFO:root:Server localhost:10200 is online
run_test(
'localhost',
10200,
'mp3',
)=(True, 'Success, test: mp3')
INFO:root:Success, test: mp3
await piper_tts_server(
'localhost',
10200,
'Hello World',
'run_test.mp3',
'mp3',
'en_US-amy-medium'
)=None
Process finished with exit code 0
```
Raw data
{
"_id": null,
"home_page": "https://github.com/b202i/yakyak",
"name": "yakyak",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "utility synthetic-voice wyoming-piper tts",
"author": "MakerMattDesign",
"author_email": "matt@makermattdesign.com",
"download_url": "https://files.pythonhosted.org/packages/f0/56/a69062e802a1b86b61b92f35bfff0b3985b75d3f997ca0465a65ee2d2cd9/yakyak-1.6.3.tar.gz",
"platform": null,
"description": "# YakYak\nYakYak is a utility for the local generation of synthetic voice through use of Wyoming-Piper. It 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.\n\n## Install YakYak, Docker Compose & FFMPEG\nTo install YakYak, a python virtual environment is recommended.\n\n### Step 1, create a python virtual environment and activate it\n```bash\ncd some_directory \nsudo apt install python3.8-venv\npython3 -m venv .venv \nsource .venv/bin/activate \n```\n\n### Step 2, install the YakYak package\n```bash\npip install yakyak\n```\n\n### Step 3, Install ffmpeg\nInstall ffmpeg for mac\n```bash\nbrew install ffmpeg\n```\nInstall ffmpeg for Ubuntu\n```bash\nsudo apt install ffmpeg\n```\n\n### Setup wyoming-piper in docker, on your local area network. \nIf you don't already have docker, or better yet docker-desktop, you can download and install it from [docker.com](https://docker.com).\n\nIf you don't already have a wyoming-piper __docker-compose.yml__ file, create one using YakYak. Warning, this will overwrite an existing docker-compose.yml file.\n\n```bash\nyakyak --docker > docker-compose.yml\n```\n \nNow you can start wyoming-piper in a docker container\n```bash\ndocker compose up -d --force-recreate\n```\n \n## Test installation\nIt will take a little longer the first time running YakYak, \nthe Wyoming-Piper app needs time to download voice files.\n```bash\npiper -h localhost -t mp3\n```\n \nObserve successful test results \n\n```text\nINFO:root:Server localhost:10200 is online\nINFO:root:Success, test: mp3\n```\n\n## How to use YakYak from the command line\nAs 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.\n```bash\nyakyak --help\n```\n\nCreate an mp3 file with \"Hello world\" \n```bash\necho Hello world | yakyak -f mp3 -o hello_world.mp3\n```\n\nIf you are on Linux and have aplay installed, you can do this: \n```bash\necho Hello world | yakyak | aplay\n```\nThis assumes that Docker is running on the same machine.\n\nIf Docker is running on a different machine on your network, you can do this: \n```bash\necho Hello world | yakyak --host a_different_machine.local | aplay\n```\n\n## How to use YakYak from Python\nCreate the file `test_yakyak.py` with the following content: \n```python\nfrom yakyak import is_server_online, piper_tts_server\n\nprint(f\"{is_server_online(\n 'localhost', \n 10200, \n )=}\")\n\nprint(f\"{piper_tts_server(\n 'localhost', \n 10200, \n 'Hello World',\n 'hello_world.mp3',\n 'mp3',\n 'en_US-amy-medium'\n )=}\")\n```\nNow test it\n```bash\npython3 test_yakyak.py \n```\nObserve that the server is online and a file hello_world.mp3 is created. Play the mp3 and you will hear \"Hello world\".\n\n```text\nrun.py \ncheck_ffmpeg_version()='ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers'\nis_server_online(\n 'localhost', \n 10200, \n )=True\nINFO:root:Server localhost:10200 is online\nrun_test(\n 'localhost', \n 10200, \n 'mp3',\n )=(True, 'Success, test: mp3')\nINFO:root:Success, test: mp3\nawait piper_tts_server(\n 'localhost', \n 10200, \n 'Hello World',\n 'run_test.mp3',\n 'mp3',\n 'en_US-amy-medium'\n )=None\n\nProcess finished with exit code 0\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Utility for local generation of synthetic voice using Wyoming-Piper.",
"version": "1.6.3",
"project_urls": {
"Homepage": "https://github.com/b202i/yakyak"
},
"split_keywords": [
"utility",
"synthetic-voice",
"wyoming-piper",
"tts"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d192b7079c2c57758fe7397fe629c756190680104fded0a58a34652742154d12",
"md5": "3a73a2c69e024b8cf0c504235c40b599",
"sha256": "841f3e55fab0550a01ebecbc9ad0a79faabdde9a38c9179be0d7db810b8469d5"
},
"downloads": -1,
"filename": "yakyak-1.6.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3a73a2c69e024b8cf0c504235c40b599",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7492,
"upload_time": "2025-01-25T20:27:39",
"upload_time_iso_8601": "2025-01-25T20:27:39.393216Z",
"url": "https://files.pythonhosted.org/packages/d1/92/b7079c2c57758fe7397fe629c756190680104fded0a58a34652742154d12/yakyak-1.6.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f056a69062e802a1b86b61b92f35bfff0b3985b75d3f997ca0465a65ee2d2cd9",
"md5": "1428d62e9e8eae6c1936f1b52446797c",
"sha256": "11a6d60669c0e9706274936967689865c5c0036db2438d99fc7f20cec19caa74"
},
"downloads": -1,
"filename": "yakyak-1.6.3.tar.gz",
"has_sig": false,
"md5_digest": "1428d62e9e8eae6c1936f1b52446797c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7299,
"upload_time": "2025-01-25T20:27:40",
"upload_time_iso_8601": "2025-01-25T20:27:40.505487Z",
"url": "https://files.pythonhosted.org/packages/f0/56/a69062e802a1b86b61b92f35bfff0b3985b75d3f997ca0465a65ee2d2cd9/yakyak-1.6.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-25 20:27:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "b202i",
"github_project": "yakyak",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "soundfile",
"specs": [
[
">=",
"0.13.0"
]
]
},
{
"name": "wyoming",
"specs": [
[
">=",
"1.5.4"
]
]
}
],
"lcname": "yakyak"
}