Usage: noahs_tts
Getting Started
First, install the library:
pip install noahs_tts
Quick start
from noahs_tts import TTS # if you saved the class in tts.py
tts = TTS()
tts.say("Hello world!") # blocks until finished
Speak sentence-by-sentence (default) for snappier responsiveness:
tts.say("First sentence. Second sentence! Third sentence?")
Speak the whole string as one chunk:
tts.say("This will be spoken as a single utterance.", split_sentences=False)
Speak the contents of a stream generator:
def example_generator():
for s in ["hello there", "this is a stream", "last chunk here"]:
yield s
tts.say_stream(example_generator())
Voice management
List available voices (id, name, locale, gender when available):
voices = tts.voices()
for v in voices:
print(v["id"], v["name"], v["locale"], v["gender"])
Pick a voice by name or id (partial match allowed):
tts = TTS(voice="Zira") # Windows example
tts = TTS(voice="Samantha") # macOS example
tts = TTS(voice="english-us") # Linux/eSpeak example
Control rate
Rate is engine-specific “words per minute” style. This wrapper casts to int.
tts = TTS(rate=180) # set default on init
tts.say("Speaking at 180 wpm (approx).")
tts.say("Speed this one up.", split_sentences=False)
You can also override per-call when saving/synthesizing:
data = tts.synth("Faster line.", rate=220)
Save audio
Get WAV bytes:
wav_bytes = tts.synth("Save me to a file later.")
with open("out.wav", "wb") as f:
f.write(wav_bytes)
Or save directly:
tts.save("Write this straight to disk.", "speech.wav", voice="Samantha", rate=170)
Check out Source Code
https://github.com/jonesnoah45010/noahs_tts
Release files for noahs-tts 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| noahs_tts-0.1.2.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| noahs_tts-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / noahs_tts-0.1.2.tar.gz
| Download URL | noahs_tts-0.1.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f1cb7a4429799c868b9004fc143f733152b97909396383cf9b51f88f91a4643
|
|
BLAKE2b-256 checksum How to use checksums |
987eb51aa21d0478a97676f1e03afe7bd644180309d41ea904d163311c3758c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|
Release files / noahs_tts-0.1.2-py3-none-any.whl
| Download URL | noahs_tts-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae372a0d0534dc791749963dd2078f43692640ce48e0784db004174f92630d49
|
|
BLAKE2b-256 checksum How to use checksums |
b8eb3fef9f49ae5a6d213049275b32a5b1f3f079c8ada36c0c961393ae76322f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.4
|