A tool/library to quickly turn text to speech.
Project description
str2speech
Overview
str2speech is a simple command-line tool for converting text to speech using Transformer-based text-to-speech (TTS) models. It supports multiple models and voice presets, allowing users to generate high-quality speech audio from text.
Features
- Supports multiple TTS models, including
suno/bark-small,suno/bark, andfacebook/mms-tts-eng. - Allows selection of voice presets.
- Outputs speech in
.wavformat. - Works with both CPU and GPU.
Installation
To install str2speech, first make sure you have pip installed, then run:
pip install str2speech
Usage
Command Line
Run the script via the command line:
python -m str2speech.main --text "Hello, world!" --output hello.wav
Options
--text(-t): The text to convert to speech (required).--voice(-v): The voice preset to use (optional, defaults to a predefined voice).--output(-o): The output.wavfile name (optional, defaults tooutput.wav).--model(-m): The TTS model to use (optional, defaults tosuno/bark-small).
Example:
python -m str2speech.main -t "This is an AI-generated voice." -o speech.wav -m suno/bark
API Usage
You can also use str2speech as a Python module:
from str2speech.speaker import Speaker
speaker = Speaker()
speaker.text_to_speech("Hello, this is a test.", "test.wav")
Available Models
The following models are supported:
suno/bark-small(default)suno/barkfacebook/mms-tts-engfacebook/mms-tts-deufacebook/mms-tts-frafacebook/mms-tts-spafacebook/mms-tts-hin
Dependencies
transformerstorchscipy
License
This project is licensed under the GNU General Public License V3.
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 str2speech-0.1.2.tar.gz.
File metadata
- Download URL: str2speech-0.1.2.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb7cd3774003bda2e4d96d3e83024e1a87b9c6231b18204bd63dd5b365ad69ff
|
|
| MD5 |
cdf4baeee6507c76038ff2ca16cc1194
|
|
| BLAKE2b-256 |
cc7d1b88a96c20cd9a86a44fd1b0a1e67e978644c90dea07d99df1d68659eb44
|
File details
Details for the file str2speech-0.1.2-py3-none-any.whl.
File metadata
- Download URL: str2speech-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57d4a1b641f6dc1cc5bb94a7edbc887998e3a988011163f16cae0d7ddbff29a4
|
|
| MD5 |
7e30760fc9010bce3dfecebabb86c686
|
|
| BLAKE2b-256 |
eeac043b979eb36bc2f2da2d11808cc1d3d0d67e129042e518300056b01ca6b7
|