- Add tts_lang.patch to allow setting language of TTS

(gh#wustho/epy#43).

OBS-URL: https://build.opensuse.org/package/show/Education/epy?expand=0&rev=5
This commit is contained in:
Matej Cepl 2021-12-17 10:14:47 +00:00 committed by Git OBS Bridge
parent b17da87b9f
commit 439e0439bd
3 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Fri Dec 17 10:13:56 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Add tts_lang.patch to allow setting language of TTS
(gh#wustho/epy#43).
-------------------------------------------------------------------
Sat Nov 27 10:19:32 UTC 2021 - mcepl@cepl.eu
- Update to version 2021.10.23+git.1636702550.2ab1584:
* Fixed reset to beginning of row when resizing term and Seamless==True
* Implement SeamlessBetweenChapters Squashed commit of the following:
* Minor annotation & prevent next page animation on edge of book
* Removed Board class
* Added TextStructure dataclass
* Give styling to images
* Better image opening scheme
* Refactor parser.get_lines(width) to get_lines(textwidth)
* Fixed image cursor on double spread and progress pctg in double spread
* Refactor variables
-------------------------------------------------------------------
Wed Jul 28 23:20:26 UTC 2021 - Emily Roberts <nopeinomicon@posteo.net>

View File

@ -24,6 +24,9 @@ License: GPL-3.0-only
URL: https://github.com/wustho/epy
# Source: https://files.pythonhosted.org/packages/source/e/epy-reader/epy-reader-%%{version}.tar.gz#/epy-%%{version}.tar.gz
Source: epy-%{version}.tar.gz
# PATCH-FIX-UPSTREAM tts_lang.patch gh#wustho/epy#43 mcepl@suse.com
# Allow setting language of TTS engine.
Patch0: tts_lang.patch
BuildRequires: fdupes
BuildRequires: python3-mobi
BuildRequires: python3-setuptools

21
tts_lang.patch Normal file
View File

@ -0,0 +1,21 @@
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,
)