feat: Supertonic language + total_steps propagation

Language enum expanded from 9 to 33 languages:
- Added 24 new ISO 639-1 languages: AR, BG, CS, DA, DE, EL, ET, FI,
  HR, HU, ID, KO, LT, LV, NL, PL, RO, RU, SK, SL, SV, TR, UK, VI
- Updated display_name, is_cjk (added KO)

Supertonic language mapping (32 languages, no ZH):
- engine.py: _SUPERTONIC_LANG_MAP, engine_language(), supported_languages()
- __init__.py: create_engine() passes config.language to pipeline
- pipeline.py: __init__() accepts language, resolves to ISO code;
  __call__() passes lang= to TTS.synthesize()

total_steps propagation:
- tts_segments(): +total_steps param, conditionally passed to backend
- synthesize_text(): +total_steps param
- run_tts_segment_loop(): +total_steps param
- executor: all 5 synthesize_text() calls pass total_steps

Integration:
- pipeline_factory: create_pipeline_for_job() passes language to supertonic
- preview path: create_pipeline('supertonic', language=language)

Tests updated to accept total_steps in FakeBackend.__call__
This commit is contained in:
Artem Akymenko
2026-07-28 14:09:42 +03:00
parent 953bef1e71
commit 2b70b9ca45
14 changed files with 146 additions and 15 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ class FakeBackend:
def __init__(self):
self.synthesized: List[str] = []
def __call__(self, text: str, *, voice: Any, speed: float = 1.0, split_pattern: str = "") -> List:
def __call__(self, text: str, *, voice: Any, speed: float = 1.0, split_pattern: str = "", **kwargs: Any) -> List:
self.synthesized.append(text)
class FakeSegment:
+1 -1
View File
@@ -58,7 +58,7 @@ class FakeBackend:
self.segment_duration = segment_duration
self.call_count = 0
def __call__(self, text: str, voice: Any, speed: float = 1.0, split_pattern: str = ""):
def __call__(self, text: str, voice: Any, speed: float = 1.0, split_pattern: str = "", **kwargs: Any):
self.call_count += 1
# Return fake segment objects with required attributes
@dataclass
+1 -1
View File
@@ -73,7 +73,7 @@ class FakeBackend:
def __init__(self):
self.synthesized: List[str] = []
def __call__(self, text: str, *, voice: Any, speed: float = 1.0, split_pattern: str = "") -> List:
def __call__(self, text: str, *, voice: Any, speed: float = 1.0, split_pattern: str = "", **kwargs: Any) -> List:
"""Return fake TTS segments."""
self.synthesized.append(text)
+1 -1
View File
@@ -33,7 +33,7 @@ class TestCreatePipelineForJob:
def test_supertonic_provider(self, _reg, mock_create):
mock_create.return_value = MagicMock()
result = create_pipeline_for_job("supertonic", Language.EN_US, use_gpu=True)
mock_create.assert_called_once_with("supertonic")
mock_create.assert_called_once_with("supertonic", language=Language.EN_US)
assert result is mock_create.return_value
@patch("abogen.domain.pipeline_factory.create_pipeline")
+1 -1
View File
@@ -49,7 +49,7 @@ def _make_mock_engine() -> Any:
from plugins.kokoro.engine import KokoroEngine
class MockPipeline:
def __call__(self, text, voice, speed, split_pattern=None):
def __call__(self, text, voice, speed, split_pattern=None, **kwargs):
class MockSegment:
def __init__(self):
self.audio = MockAudio()