File size: 610 Bytes
62e3411
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""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