Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import torch
# 🇮🇳 'h' => Hindi hi
# 🇮🇹 'i' => Italian it
# 🇯🇵 'j' => Japanese: pip install misaki[ja]
# 🇳🇴 'nb' => Norwegian Bokmål nb
# 🇳🇴 'nn' => Norwegian Nynorsk nn
# 🇧🇷 'p' => Brazilian Portuguese pt-br
# 🇨🇳 'z' => Mandarin Chinese: pip install misaki[zh]
pipeline = KPipeline(lang_code='a') # <= make sure lang_code matches voice, reference above.
Expand Down
1 change: 1 addition & 0 deletions kokoro/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from misaki import espeak
__version__ = '0.9.4'

from loguru import logger
Expand Down
4 changes: 2 additions & 2 deletions kokoro/custom_stft.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def __init__(

# Precompute inverse DFT
# Real iFFT formula => scale = 1/n_fft, doubling for bins 1..freq_bins-2 if n_fft even, etc.
# For simplicity, we won't do the "DC/nyquist not doubled" approach here.
# If you want perfect real iSTFT, you can add that logic.
# For simplicity, we won't do the "DC/nyquist not doubled" approach here.
# If you want perfect real iSTFT, you can add that logic.
# This version just yields good approximate reconstruction with Hann + typical overlap.
inv_scale = 1.0 / self.n_fft
n = np.arange(self.n_fft)
Expand Down
10 changes: 7 additions & 3 deletions kokoro/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
'hi': 'h',
'it': 'i',
'pt-br': 'p',
'no': 'nb',
'no-nb': 'nb',
'nn': 'nn',
'no-nn': 'nn',
'ja': 'j',
'zh': 'z',
}
Expand All @@ -31,6 +35,8 @@
h='hi',
i='it',
p='pt-br',
nb='nb',
nn='nn',

# pip install misaki[ja]
j='Japanese',
Expand Down Expand Up @@ -96,12 +102,10 @@ def __init__(
raise RuntimeError("CUDA requested but not available")
if device == 'mps' and not torch.backends.mps.is_available():
raise RuntimeError("MPS requested but not available")
if device == 'mps' and os.environ.get('PYTORCH_ENABLE_MPS_FALLBACK') != '1':
raise RuntimeError("MPS requested but fallback not enabled")
if device is None:
if torch.cuda.is_available():
device = 'cuda'
elif os.environ.get('PYTORCH_ENABLE_MPS_FALLBACK') == '1' and torch.backends.mps.is_available():
elif torch.backends.mps.is_available():
device = 'mps'
else:
device = 'cpu'
Expand Down