swisscore-pyTTS
Easy to use python Text To Speech (TTS) library.
Currently supported API's:
- Voice RSS (api key needed)
Note: More API's might beeing added in the future.
Installation
Note: If you are on macOS or Linux you may have to use pip3.
pip install git+https://github.com/SwissCorePy/swisscore-pyTTS/
Quick Start
import os
from pathlib import Path
# Import VoiceRSS API
from pytts import VoiceRSS
# To avoid writing your API key in source code, you can set it in an environment
# variable API_KEY, then read the variable in your Python code:
api_key = os.getenv("API_KEY")
# The text to turn into speech
text = "Hello. Thank you for downloading this package."
# Setup API instance with default values
tts = VoiceRSS(
api_key,
hl=VoiceRSS.hl.en_us, # Set English (United States) as default
v=VoiceRSS.v.en_us.John, # Set John as default voice
c=VoiceRSS.c.MP3, # Set MP3 as default codec
f=VoiceRSS.f.stereo_16khz_16bit, # Set 16khz, 16bit, stereo as default
)
# The outupt file path
out = Path(__file__).parent / "test.mp3"
# Turn the text into a file
if file := tts.to_file(text, out):
print(f"Success! Now you can do with {file.name} what you want.")
pass
Metadata
Release files for swisscore-pyTTS 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swisscore-pyTTS-1.0.0.tar.gz | 19.7 kB | Without provenance | Details for swisscore-pyTTS-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swisscore_pyTTS-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for swisscore_pyTTS-1.0.0-py3-none-any.whl |
Total release size: 39.4 kB
Release files / swisscore-pyTTS-1.0.0.tar.gz
| Download URL | swisscore-pyTTS-1.0.0.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf5636e37a68d500fb931f32340e9e72ba0be4125cbe2d56b3222366771ebdba
|
|
BLAKE2b-256 checksum How to use checksums |
e3da01b944e9cd06c48b042b563d1c90051f15b4aa723eb6178727e17765e81f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Release files / swisscore_pyTTS-1.0.0-py3-none-any.whl
| Download URL | swisscore_pyTTS-1.0.0-py3-none-any.whl |
|---|---|
| Size | 19.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81386d35eb1be6465141110670033756bf3fb7dd4f8c37a2902f338eb6d1cfce
|
|
BLAKE2b-256 checksum How to use checksums |
7a00b6ac1b7536faf92fa3b9bb7daf0e31dc9b02b89a350a67e1fb2a5201f592
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Security for swisscore-pyTTS 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.