aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2021-12-18 02:29:10 +0100
committerGitHub <noreply@github.com>2021-12-18 08:29:10 +0700
commit16481ec493b8065957b6681ed3bfb60b6e1d9799 (patch)
tree612281025faf766da9653691d8b1542e10750386
parent2ab1584d2e05b95587d209280b5a56811e651d72 (diff)
downloadepy-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--.gitignore2
-rwxr-xr-xepy.py3
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/*
diff --git a/epy.py b/epy.py
index 11eca60..d4ea184 100755
--- a/epy.py
+++ b/epy.py
@@ -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,
)