Skip to content

Commit

Permalink
Only english voices are loaded. Support for other languages might com…
Browse files Browse the repository at this point in the history
…e later
  • Loading branch information
h43lb1t0 committed Feb 2, 2025
1 parent 849d355 commit e7503f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Enhance your text generation experience with the Kokoro TTS extension, seamlessl

## Features

**Current Version:** Kokoro v1
**Supported Languages:** English

Kokoro TTS is limited to inputs up to **510 tokens**. *Note that Kokoro tokens differ from LLM tokens.* This extension allows you to generate longer audio outputs by splitting the input text into segments and concatenating the resulting audio.

### Text Splitting Methods
Expand Down Expand Up @@ -65,6 +68,7 @@ By default, the extension utilizes the first available GPU. To specify a differe
- [x] Kokoro v1
- [x] Support for all operating systems
- [x] Voice selection feature
- [ ] Support for other languages than English
- [ ] Support for future versions of Kokoro
## Contributing
Expand Down
1 change: 1 addition & 0 deletions src/kokoro.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def normalize_text(text):
return text.strip()

def get_vocab():
# Probably needs updates starting here to support other languages
_pad = "$"
_punctuation = ';:,.!?¡¿—…"«»“” '
_letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
Expand Down
3 changes: 3 additions & 0 deletions src/voices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
snapshot_path = snapshot_path / os.listdir(snapshot_path)[0]
voices = os.listdir(snapshot_path / 'voices')
VOICES = [voice.replace('.pt', '') for voice in voices]

# Filter the voices to only english voices
VOICES = [voice for voice in VOICES if voice.startswith(('a', 'b'))]

0 comments on commit e7503f2

Please sign in to comment.