diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2021-12-18 02:29:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-18 08:29:10 +0700 |
commit | 16481ec493b8065957b6681ed3bfb60b6e1d9799 (patch) | |
tree | 612281025faf766da9653691d8b1542e10750386 | |
parent | 2ab1584d2e05b95587d209280b5a56811e651d72 (diff) | |
download | epy-16481ec493b8065957b6681ed3bfb60b6e1d9799.tar.gz |
Allow setting language for TTS. (#43)
There is now setting option TTSLang, which must set to one
language supported by pico2wave.
Fixes #42
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | epy.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9aa4ec5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__/* +epy_reader.egg-info/* @@ -195,6 +195,7 @@ class Settings: MouseSupport: bool = False StartWithDoubleSpread: bool = False TTSSpeed: int = 1 + TTSLang: str = "en-US" # -1 is default terminal fg/bg colors DarkColorFG: int = 252 DarkColorBG: int = 235 @@ -2336,7 +2337,7 @@ class Reader: try: _, path = tempfile.mkstemp(suffix=".wav") subprocess.call( - ["pico2wave", "-w", path, text], + ["pico2wave", f"--lang={self.setting.TTSLang}", "-w", path, text], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) |