mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Read aloud: Fix no audio produced when text contains <3 and using the Windows legacy speech engine. Fixes #2092948 [TTS Fail <3](https://bugs.launchpad.net/calibre/+bug/2092948)
This commit is contained in:
parent
d2e499fe3e
commit
dd1c998cb6
@ -11,7 +11,7 @@ from calibre.gui2.main_window import MainWindow
|
|||||||
from calibre.gui2.tts.manager import TTSManager
|
from calibre.gui2.tts.manager import TTSManager
|
||||||
|
|
||||||
TEXT = '''\
|
TEXT = '''\
|
||||||
Demonstration 🐈 of DOCX support in calibre
|
Demonstration 🐈 of DOCX <3 support in calibre
|
||||||
|
|
||||||
This document demonstrates the ability of the calibre DOCX Input plugin to convert the various typographic features in a Microsoft Word
|
This document demonstrates the ability of the calibre DOCX Input plugin to convert the various typographic features in a Microsoft Word
|
||||||
(2007 and newer) document. Convert this document to a modern ebook format, such as AZW3 for Kindles or EPUB for other ebook readers,
|
(2007 and newer) document. Convert this document to a modern ebook format, such as AZW3 for Kindles or EPUB for other ebook readers,
|
||||||
|
@ -53,9 +53,11 @@ class QtTTSBackend(TTSBackend):
|
|||||||
def say(self, text: str) -> None:
|
def say(self, text: str) -> None:
|
||||||
self.last_word_offset = 0
|
self.last_word_offset = 0
|
||||||
self.last_spoken_word = None
|
self.last_spoken_word = None
|
||||||
self.speaking_text = text
|
|
||||||
if self.tts.engine() == 'sapi':
|
if self.tts.engine() == 'sapi':
|
||||||
|
# https://bugs.launchpad.net/bugs/2092948
|
||||||
|
text = text.replace('<3', ' 3')
|
||||||
self.ignore_tracking_until_state_changes_to_speaking = True
|
self.ignore_tracking_until_state_changes_to_speaking = True
|
||||||
|
self.speaking_text = text
|
||||||
self.tts.say(text)
|
self.tts.say(text)
|
||||||
|
|
||||||
def error_message(self) -> str:
|
def error_message(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user