piper-plus-demo / app_imports.py
ayousanz's picture
Update from GitHub Actions - 2025-07-31 15:10:28
62e3411 verified
raw
history blame contribute delete
610 Bytes
"""Optional imports for text-to-phoneme conversion"""
# These imports are optional and loaded dynamically
# to allow the app to work with fallback methods
try:
import importlib.util
if importlib.util.find_spec("pyopenjtalk") is not None:
PYOPENJTALK_AVAILABLE = True
else:
PYOPENJTALK_AVAILABLE = False
except ImportError:
PYOPENJTALK_AVAILABLE = False
try:
import importlib.util
if importlib.util.find_spec("espeak_phonemizer") is not None:
ESPEAK_AVAILABLE = True
else:
ESPEAK_AVAILABLE = False
except ImportError:
ESPEAK_AVAILABLE = False