mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-22 07:10:28 +02:00
fix(webui): voice.py imports from domain modules instead of conversion_runner
Replace private imports (_select_device, _to_float32, SAMPLE_RATE, SPLIT_PATTERN) from abogen.webui.conversion_runner with proper domain imports: - select_device from abogen.domain.device - to_float32, SAMPLE_RATE from abogen.domain.audio_helpers - SPLIT_PATTERN defined locally (r'\n+') Also verifies preview.py already uses domain imports correctly. 7 new tests in tests/test_domain_imports.py enforce the architecture rule.
This commit is contained in:
@@ -21,7 +21,10 @@ from abogen.constants import (
|
||||
from abogen.tts_plugin.utils import get_voices
|
||||
from abogen.speaker_configs import list_configs
|
||||
from abogen.tts_plugin.utils import create_pipeline
|
||||
from abogen.webui.conversion_runner import _select_device, _to_float32, SAMPLE_RATE, SPLIT_PATTERN
|
||||
from abogen.domain.device import select_device as _select_device
|
||||
from abogen.domain.audio_helpers import to_float32 as _to_float32, SAMPLE_RATE
|
||||
|
||||
SPLIT_PATTERN = r"\n+"
|
||||
|
||||
_preview_pipeline_lock = threading.RLock()
|
||||
_preview_pipelines: Dict[Tuple[str, str], Any] = {}
|
||||
|
||||
Reference in New Issue
Block a user