mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 11:40:57 +02:00
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:
@@ -32,11 +32,12 @@ from abogen.tts_plugin.types import EngineConfig
|
||||
from .engine import SuperTonicEngine
|
||||
|
||||
|
||||
def _load_supertonic_pipeline() -> Any:
|
||||
def _load_supertonic_pipeline(language: Any = None) -> Any:
|
||||
"""Lazy-load SuperTonic dependencies and create pipeline."""
|
||||
from plugins.supertonic.pipeline import SupertonicPipeline
|
||||
|
||||
return SupertonicPipeline(
|
||||
language=language,
|
||||
sample_rate=24000,
|
||||
auto_download=True,
|
||||
total_steps=5,
|
||||
@@ -128,7 +129,7 @@ def create_engine(
|
||||
EngineError: On failure. Cleans up partially created resources.
|
||||
"""
|
||||
try:
|
||||
pipeline = _load_supertonic_pipeline()
|
||||
pipeline = _load_supertonic_pipeline(language=config.language)
|
||||
engine = SuperTonicEngine(pipeline)
|
||||
return engine
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user