Python Text to Speach using Microsoft Sapi5 with a server/client model
Project description
WillSpeak - Work in Progress
Python Text to Speach using Microsoft Sapi5 with a server/client model.
Progress update
The core functionality is now working, and is ready for testing. Some cleanup is still required, but it works. Only supports SAPI5 for now. More to come in the future.
Info
I created this project as a way to have good TTS on linux, because TTS on linux at the moment is dreadful. For a long time I wanted to switch to linux, but I needed a good linux TTS software but could not find one. So I decided to create this project to interface with the windows SAPI5 TTS engine.
How it works is by running this software in server mode on a Windows machine. Then configure the linux client to communicate with that Windows TTS server. The client will monitor for text that was copied to the clipboard and converts the text into speech.
Usage
This software has 2 different operational modes, "Local" & "Server/Client". If the TTS engine that you have selected works natively on your operating system, Then you can use Local mode. e.g. SAPI5 is native to windows, so you can use Local mode on Windows when using SAPI5. You should use Server/Client if you want to use SAPI5 on linux. It requires python 3.10 or grater.
Install using pip
python3 -m pip install willspeak
Run locally on Windows
willspeak local
To run in server mode do.
willspeak server
And on the client machine run. "--addr" is the address of the server running the server component.
# 192.168.1.60 is just an example
willspeak client --addr=192.168.1.60
There is one last command that is used to stop any current speech.
willspeak stop
TODO
- Setup prometheus metrics to track usage. This is useful if you wish to use a paid for TTS Service.
- Add support for other text to speech engines, like eSpeak.
- Add support for running the server component as a Windows service.
- Change the way things are configured from CLI args to web interface.
- Document how to enable more SAPI5 voices.
- See if there is a way to hide the useless stderr output from pyaudio on linux.
Enable Extra SAPI5 Voices
Extra SAPI5 voices can be installed by going to Settings -> Time & Language -> Speech. Click the plus icon next to add voices in the Manage voices section. Here you will see a full list of available voices for a given language. Select language voice you want and click add. This will download and install the new voices. They will be available for preview when you close and re-open the settings app.
You can even use the Cortana voice (Eva) for SAPI5, but this requires a registry tweak to be able to enable it. And also requires you to have the English (US) language pack installed. This is the best female voice in my opinion. But if you are looking for a male voice then Richard is the best, available in the English (Canada) voice package.
Links
https://winaero.com/unlock-extra-voices-windows-10/
Version
0.3.0
Project details
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
File details
Details for the file willspeak-0.4.0.tar.gz
.
File metadata
- Download URL: willspeak-0.4.0.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afe00a333ca25749291ff94c099aa0118e2bb5d84a585c5bf516d53b253b7502 |
|
MD5 | e9b09827ecc387a812e5f9c9585d49f9 |
|
BLAKE2b-256 | 08b48dfa510a436444c1fde2ef84a6ff5ff9a5069f18a706a955f138ab7c753f |
File details
Details for the file willspeak-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: willspeak-0.4.0-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6309756bfd21a6e35480929fd9300a3b653628731c7d8e1c4062ad3e3d74eaa2 |
|
MD5 | 8a8199269b65e297a92ed1be3acd4c9c |
|
BLAKE2b-256 | d314a2d24225b31bac01600d2aec46141aa4c2e659703173853300e52223a9e2 |