debug
This commit is contained in:
parent
d4f6b7361f
commit
c887fd3cfb
|
@ -10,8 +10,6 @@ DetectorFactory.seed = 0
|
|||
|
||||
TEXT = sys.argv[1]
|
||||
LANG = detect(TEXT) if sys.argv[2] == "Auto" else sys.argv[2]
|
||||
if LANG == "zh-cn" or LANG == "zh-tw":
|
||||
LOCALE = LANG[:-2] + LANG[-2:].upper()
|
||||
RATE = sys.argv[3]
|
||||
VOLUME = sys.argv[4]
|
||||
GENDER = sys.argv[5] if len(sys.argv) == 6 else None
|
||||
|
@ -23,7 +21,9 @@ print(f"Text: {TEXT}, Language: {LANG}, Gender: {GENDER}, Rate: {RATE}, Volume:
|
|||
async def _main() -> None:
|
||||
voices = await VoicesManager.create()
|
||||
if not GENDER is None:
|
||||
# From "zh-cn" to "zh-CN" etc.
|
||||
if LANG == "zh-cn" or LANG == "zh-tw":
|
||||
LOCALE = LANG[:-2] + LANG[-2:].upper()
|
||||
voice = voices.find(Gender=GENDER, Locale=LOCALE)
|
||||
else:
|
||||
voice = voices.find(Gender=GENDER, Language=LANG)
|
||||
|
|
Loading…
Reference in New Issue