echo but with TTS.
Project description
Say: echo but with TTS
Say uses OpenVoice v2 to create convincing voices for TTS application.
Installation
pip install tts-say
# Or from source
pip install git+https://gitlab.com/waser-technologies/technologies/say.git
Usage
❯ say Hello World
Hello World
❯ say --help
usage: say [-h] [-n] [-e] [-E] [-v] [-L LANG] [--out_path OUT_PATH]
[--debug DEBUG]
[text ...]
Same as echo but with Text-To-Speech.
positional arguments:
text Text to be said.
options:
-h, --help show this help message and exit
-n, --n do not output the trailing newline
-e, --e enable interpretation of backslash escapes
-E, --E disable interpretation of backslash escapes (default)
-v, --version output version information and exit
-L LANG, --lang LANG Language to be spoken (default: $LANG)
--out_path OUT_PATH Output wav file path.
--debug DEBUG true to enable debug mode.
Start the server
First you need to load the models in memory.
To do so, start the TTS server using say
without any text
argument.
say [--debug DEBUG]
No attribute `text`.
say --help
For more information.
Starting server now.
Please wait.
...
Or enable its service.
cp ./speak.service.example /usr/lib/systemd/user/speak.service
systemctl --user enable --now speak.service
Get authorization to speak
You need to authorize the system to speak first. Change the service configuration as follows.
# ~/.assistant/tts.toml
...
[tts]
is_allowed = true
...
Then start the server and use say
with some text
argument to say something.
Use the client
Before you use the client, make sure :
- the system has a valid authorization to speak,
- the server has correctly loaded the models,
- if the server has loaded
YourTTS
(by default); you need to create astyle_wav
file of your default speaker.
say [-n] [-e] [-E] [-v] [-L LANG] [--out_path OUT_PATH] [text ...]
❯ say --version
Say: version 3.0.1a2
Copyright © 2024, Danny Waser
Say, version 3.0.1a2.
...
❯ say Hello, this is a test
Hello, this is a test
Save the audio
To save the resulted speech, use the argument --out_path
.
❯ say "Bonjour." --out_path "say_output.wav"
Bonjour.
❯ soxi say_output.wav
Input File : 'say_output.wav'
Channels : 1
Sample Rate : 16000
Precision : 16-bit
Duration : 00:00:01.17 = 18726 samples ~ 87.7781 CDDA sectors
File Size : 37.5k
Bit Rate : 256k
Sample Encoding: 16-bit Signed Integer PCM
Setup your own voice
Before saying anything, you need to add a wav file to ~/.assistant/data/${lang}/TTS/styles/${voice_name}/${voice_name}.wav
.
Where $lang
is your target language (i.e en
, fr
, etc.) and $voice_name
is the name of your voice.
This wav file must contain between 5 and 15 seconds of speech.
Make sure it matches with your tts.toml
configuration. (i.e voice_name
)
Don't want to hunt down a voice?
Checkout my collection of high quality TTS voices generated using TTS VTCK/VITS models.
Audio samples
Yes yes but echo is for text right ?
Yes but you should be able to alias
echo
to say
inside your favorite shell.
Because when you think about it, asking your computer to say something
is like asking it to echo something
.
Both cases output something
.
Where echo repeat what it got in stdin, say as an injonction is used to ask someone to repeat what comes after.
Like so :
❯ Assistant, say Hello.
[Assistant] Hello.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tts_say-3.0.3a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ee400e4ddaf73b5531fc08d5024258159a99c3d98a03c5be3e0ab48b459dfba |
|
MD5 | 862ed71b6df045bf1b8515285450ecab |
|
BLAKE2b-256 | 25c64fee36efff4297d7075a7c75bc987b877bbbfecf75aa8e0ce48a4c4226ac |