diff --git a/README.md b/README.md index 765dcc7..5b03adb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/kokoro/__init__.py b/kokoro/__init__.py index 9156e5c..6307ffc 100644 --- a/kokoro/__init__.py +++ b/kokoro/__init__.py @@ -1,3 +1,4 @@ +from misaki import espeak __version__ = '0.9.4' from loguru import logger diff --git a/kokoro/custom_stft.py b/kokoro/custom_stft.py index c9cf0d2..b412fcd 100644 --- a/kokoro/custom_stft.py +++ b/kokoro/custom_stft.py @@ -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) diff --git a/kokoro/pipeline.py b/kokoro/pipeline.py index 3377069..8a4d58e 100644 --- a/kokoro/pipeline.py +++ b/kokoro/pipeline.py @@ -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', } @@ -31,6 +35,8 @@ h='hi', i='it', p='pt-br', + nb='nb', + nn='nn', # pip install misaki[ja] j='Japanese', @@ -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'