Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charlesaverill/ttsdg
A package to automate TTS data generation
https://github.com/charlesaverill/ttsdg
Last synced: about 6 hours ago
JSON representation
A package to automate TTS data generation
- Host: GitHub
- URL: https://github.com/charlesaverill/ttsdg
- Owner: CharlesAverill
- License: gpl-3.0
- Created: 2020-04-17T22:41:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T02:50:40.000Z (about 4 years ago)
- Last Synced: 2024-09-23T05:50:03.401Z (about 2 months ago)
- Language: Python
- Size: 488 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TTSDG
TTSDG, or Text-To-Speech Data Generator, automates the simple-but-frustrating task of generating large amounts of TTS
data for tasks like machine learning. TTSDG contains an easy-to-use class that can generate text offline, in large
batches, and with control over the system voices that you have installed. TTSDG randomizes volume, speed, and voice of
each sample, and prevents duplicates from happening.TTSDG utilizes [pyttsx3](https://pypi.org/project/pyttsx3/) and [pydub](https://pypi.org/project/pydub/) to generate the
audio and convert it into multiple formats. All pydub-supported formats are supported in TTSDG, like WAV, MP3, and AIFF.# Installation
TTSDG is available through pip:`python3 -m pip install ttsdg`
# Usage
```python
from ttsdg import TTSDGfor word in ["Apple", "Orange", "Banana"]:
print(word)gen = TTSDG(verbose=True)
gen.volume_range = [.5, 1.0]
gen.wpm_range = [200, 300]
gen.generate(word, 100, out_format="wav")
# A bug in pyttsx3 will cause hangs on generation
# in loops sometimes. del the generator at the end
# of the loop to solve this
del gen
```# Methods
- `set_volume_range(low, high, one)` - Set low or high volume bounds, or set `one` for a specific value.
- `set_wpm_range(low, high, one)` - Set low or high speed bounds (in words per minute), or set `one` for a specific
value.
- `set_voices(voices)` - Only mess around with this if you know what you're doing. Sets the list of voices to choose
from, relies on what system voices you have installed.
- `set_engine(engine)` - Only mess around with this if you know what you're doing. Sets the pyttsx3 Engine object,
useful for importing settings if your project already has an engine.
- `get_engine()` - Gets the pyttsx3 engine object.
- `generate(text, n, out_format)` - Generates `n` samples of the input `text`, saves them to
`./(text)/(text)_index.(out_format)`