py3-ttsmms
(A fork of ttsmms by wannaphong) Text-to-speech with The Massively Multilingual Speech (MMS) project from Meta.
This project want to help you for use Text-to-speech model from MMS project in Python. We aim to keep functioanlity minimal. Other projects such as py3-ttswrapper will provide more features.
Support 1,107 Languages! (See support_list.txt)
Don't forget the TTS model in MMS project use CC-BY-NC license.
Install
pip install py3-ttsmms
** Warning; There are a LOT of dependencies. If you already have Torch or PyTorch installed, you may need to uninstall it and reinstall it with the correct version. **
NB: We use the same method names as ttsmms, but the code is not compatible.
Usage
First, you need to download the model by yourself or use the code below. Note these are ISO 639-1 language codes. Youc an see the full list in support_list.txt.
from ttsmms import download
dir_path = download("eng","./data") # lang_code, dir for save model
or download file by yourself eg:
- Download the language model file. Replace "lang_code" with the language code you want to download. You can see the full list in support_list.txt kur for Kurdish, eng for English, etc.
curl https://dl.fbaipublicfiles.com/mms/tts/lang_code.tar.gz --output lang_code.tar.gz
-
extract a tar ball archive.
-
create a directory for save model
mkdir -p data && tar -xzf lang_code.tar.gz -C data/
Synthesis
from ttsmms import TTS
tts=TTS(dir_path) # or "model_dir_path" your path dir that extract a tar ball archive
wav=tts.synthesis("txt")
# output:
# {
# 'audio_bytes': b'\x00\x0',
# "x":array(wav array),
# "sampling_rate": 16000
# }
tts.synthesis("txt",wav_path="example.wav")
# output: example.wav file
Metadata
Release files for py3-ttsmms 0.8.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py3_ttsmms-0.8.25-py3-none-any.whl | Python 3 | none | any | Details |
Release files / py3_ttsmms-0.8.25-py3-none-any.whl
| Download URL | py3_ttsmms-0.8.25-py3-none-any.whl |
|---|---|
| Size | 30.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fd9ea533ecaecbe721918e3f617d36498562a0b79d8cc1f00c32dc7fad70572
|
|
BLAKE2b-256 checksum How to use checksums |
83d41062c0dec9fc20dd3514dd6c46eae48daac50c850dd973ec5a576d27e569
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|