A package to make kokoro simpler to work with
Project description
SimplerKokoro
SimplerKokoro is a Python package that makes it easy to use the Kokoro voice synthesis library.
Features
- Simple interface for generating speech audio and subtitles
- Supports all Kokoro voices
- Outputs valid SRT subtitles
Installation
Install from PyPI:
pip install Simpler-Kokoro
or clone the repo and install locally:
git clone https://github.com/WilleIshere/SimplerKokoro.git
cd SimplerKokoro
pip install .
Requirements
- Python 3.10+
- torch
- kokoro
- soundfile
All dependencies are installed automatically.
Usage
Basic Example
from Simpler_Kokoro import SimplerKokoro
# Create an instance
sk = SimplerKokoro()
# List available voices
voices = sk.list_voices()
print("Available voices:", [v['name'] for v in voices])
# Generate speech
sk.generate(
text="Hello, this is a test of the Simpler Kokoro voice synthesis.",
voice=voices[0]['name'],
output_path="output.wav"
)
Generate Speech with Subtitles
sk.generate(
text="Hello, this is a test. This is another sentence.",
voice=voices[0]['name'],
output_path="output.wav",
write_subtitles=True,
subtitles_path="output.srt",
subtititles_word_level=True
)
Generate Speech with Custom Speed
sk.generate(
text="This is spoken faster than normal.",
voice=voices[1]['name'],
output_path="fast_output.wav",
speed=1.5
)
Example Output Files
output.wav: The synthesized speech audio file.output.srt: Subtitles in SRT format (ifwrite_subtitles=True).
Sample SRT output:
1
00:00:00,000 --> 00:00:01,200
Hello,
2
00:00:01,200 --> 00:00:02,500
this is a test.
3
00:00:02,500 --> 00:00:04,000
This is another sentence.
API
SimplerKokoro
Methods
list_voices(): Returns a list of available voices with metadata.generate(text, voice, output_path, speed=1.0, write_subtitles=False, subtitles_path='subtitles.srt', subtititles_word_level=False): Generates speech audio and optional subtitles.
License
GPL-3.0 license
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
simpler_kokoro-1.1.0.tar.gz
(17.8 kB
view details)
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 simpler_kokoro-1.1.0.tar.gz.
File metadata
- Download URL: simpler_kokoro-1.1.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dc77935ae180aad7f18bd9d0c4f7312fc364d6a2324781cbd75b7a65be9a3ad
|
|
| MD5 |
3f18fc99079db8bdb6f4fb9c336b932e
|
|
| BLAKE2b-256 |
22d4510a700570c27e644569ac5da4624f912f1b5baa3a948ae9663746937029
|
File details
Details for the file simpler_kokoro-1.1.0-py3-none-any.whl.
File metadata
- Download URL: simpler_kokoro-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02851146fe86847310c159f3585c1904e0ec829ed67942750adf5ab6db547ad7
|
|
| MD5 |
585f2876c3c813f18d44020d49dc2651
|
|
| BLAKE2b-256 |
423f9d02fb0d20990d9c08f02ff81cdea5a8f6ecea0d38643f351e82405a897f
|