High-level Python wrapper for Wfloat TTS
Project description
wfloat
wfloat is the Python package for wfloat-tts, Wfloat's on-device English
text-to-speech model.
It runs speech locally in Python instead of calling a hosted inference API. The model supports 20 voices with emotion and intensity control.
If you're building for the browser, use
@wfloat/wfloat-web. If you're
building for React Native, use
@wfloat/react-native-wfloat.
Try it in the browser: https://wfloat.com/demo
Sample dialogueInstall
pip install wfloat
Usage
import wfloat
model = wfloat.load("wfloat/wfloat-tts")
result = model.generate(
text="No, no, that's not possible. The formula should have crystallized, but it adapted instead. Do you realize what that means for the rest of my work?",
voice_id="mad_scientist_woman",
emotion="surprise",
intensity=0.7,
)
result.audio.save("out.wav")
For multi-speaker dialogue:
import wfloat
model = wfloat.load("wfloat/wfloat-tts")
result = model.generate_dialogue(
segments=[
{
"voice_id": "wise_elder_man",
"text": "Rain taps against the tavern shutters as you step inside.",
"emotion": "neutral",
"intensity": 0.5,
},
{
"voice_id": "strong_hero_man",
"text": "You're late. Two bandits stole the king's map over three hours ago.",
"emotion": "fear",
"intensity": 0.6,
},
{
"voice_id": "strong_hero_man",
"text": "They fled north, up into the woods.",
"emotion": "neutral",
"intensity": 0.5,
},
],
silence_between_segments_sec=0.35,
)
result.audio.save("dialogue.wav")
You can also generate a WAV from the command line:
wfloat generate \
--text "Hello world!" \
--out out.wav \
--voice-id mad_scientist_woman \
--emotion surprise \
--intensity 0.7 \
--silence-padding-sec 0
For the full CLI help:
wfloat generate --help
The first load downloads the model assets. After that, the package uses the cached local copy.
Speaker IDs
Use voice_id string names or numeric sid values:
| Speaker | SID |
|---|---|
skilled_hero_man |
0 |
skilled_hero_woman |
1 |
fun_hero_man |
2 |
fun_hero_woman |
3 |
strong_hero_man |
4 |
strong_hero_woman |
5 |
mad_scientist_man |
6 |
mad_scientist_woman |
7 |
clever_villain_man |
8 |
clever_villain_woman |
9 |
narrator_man |
10 |
narrator_woman |
11 |
wise_elder_man |
12 |
wise_elder_woman |
13 |
outgoing_anime_man |
14 |
outgoing_anime_woman |
15 |
scary_villain_man |
16 |
scary_villain_woman |
17 |
news_reporter_man |
18 |
news_reporter_woman |
19 |
Emotions
Supported emotion labels:
neutraljoysadnessangerfearsurprisedismissiveconfusion
intensity must be between 0.0 and 1.0.
More
- Docs: https://docs.wfloat.com
- Model card, voices, emotions, and samples: https://huggingface.co/Wfloat/wfloat-tts
- Web package: https://github.com/wfloat/wfloat-web
- React Native package: https://github.com/wfloat/react-native-wfloat
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 wfloat-1.0.1.tar.gz.
File metadata
- Download URL: wfloat-1.0.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f44f40c80c80bb9ae634bba0e91a2c05f5dc6506b4ada70d42ef12a17bf610b6
|
|
| MD5 |
999afcd75159924fa2bc1e24abbc426e
|
|
| BLAKE2b-256 |
ef9ee997764a70f143aa3fec3f4c51762ab11cb117255aff39de684190b84819
|
Provenance
The following attestation bundles were made for wfloat-1.0.1.tar.gz:
Publisher:
wheels.yml on wfloat/wfloat-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wfloat-1.0.1.tar.gz -
Subject digest:
f44f40c80c80bb9ae634bba0e91a2c05f5dc6506b4ada70d42ef12a17bf610b6 - Sigstore transparency entry: 1499683621
- Sigstore integration time:
-
Permalink:
wfloat/wfloat-python@c81dc6f7b097c26d7b4c9fdcb45e0ff396f3a3fa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wfloat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@c81dc6f7b097c26d7b4c9fdcb45e0ff396f3a3fa -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file wfloat-1.0.1-py3-none-any.whl.
File metadata
- Download URL: wfloat-1.0.1-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90241f7d224cc7eebc658caf27aeb26625b48c59b3f15e9dd3ba99d7cfdf01da
|
|
| MD5 |
e7c01ec011bf7dc4975b4a9ad934bef4
|
|
| BLAKE2b-256 |
ede2c3a67ac369614edb9b1a8f38212e1ea4c05ce538b2f4f6d97e81d1fcc783
|
Provenance
The following attestation bundles were made for wfloat-1.0.1-py3-none-any.whl:
Publisher:
wheels.yml on wfloat/wfloat-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wfloat-1.0.1-py3-none-any.whl -
Subject digest:
90241f7d224cc7eebc658caf27aeb26625b48c59b3f15e9dd3ba99d7cfdf01da - Sigstore transparency entry: 1499683753
- Sigstore integration time:
-
Permalink:
wfloat/wfloat-python@c81dc6f7b097c26d7b4c9fdcb45e0ff396f3a3fa -
Branch / Tag:
refs/heads/main - Owner: https://github.com/wfloat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@c81dc6f7b097c26d7b4c9fdcb45e0ff396f3a3fa -
Trigger Event:
workflow_dispatch
-
Statement type: