Wrapper for AWS Polly with segmentation, playback queue and client-server setup
Project description
python-polly
python-polly is a simple wrapper around AWS's text-to-speech service Polly.
Features are:
- Cache requests to AWS Polly locally
- Tokenize input text into sentences or words in order to maximize usage of cache
- Playback queue for audio output
- Client-server setup to support concurrent output by multiple applications
Setup
pip install --user python-polly[server]
Most of the dependencies are only required by the server so I put them in as an extra option.
To get the dependencies for the server use python-polly[server] otherwise just python-polly.
Usage
Server
Start the server. Default port is 6000.
polly server
Client
CLI
polly say "hello world"
Python
import polly.client
polly.client.say('hello world')
Any other JSON-RPC client e.g. cURL
curl -d '{"id": "null", "jsonrpc": "2.0", "method": "say", "params": ["hello", "Joanna", "sentence", true]}' localhost:6000
Links
Playback
https://people.csail.mit.edu/hubert/pyaudio/docs/#example-callback-mode-audio-i-o
https://github.com/spatialaudio/python-sounddevice/blob/master/examples/play_long_file.py
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-polly-0.1.0.tar.gz.
File metadata
- Download URL: python-polly-0.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60d1ffaaff55dc61dbbbe9b500b2ff781689c40f186a92aaf57e926c9f833e15
|
|
| MD5 |
e4ab95aeafe56319ef3ed88e72c96ce4
|
|
| BLAKE2b-256 |
f8c148454828c41bd2d14ddc42273cf4e8c925b7b427739153fd64a10627faf0
|
File details
Details for the file python_polly-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_polly-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a65dddbabb98ed57206984528de32e28ffb4d2b470467ad5bb82e68aa2fe151
|
|
| MD5 |
c5009305f138e2fc69ae68f3bcdd4cb0
|
|
| BLAKE2b-256 |
5b6d31b98b25790f911be499d4e29071520efdd3cdff472f594798c4d81c806d
|