mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get simple speak working on windows as well
This commit is contained in:
parent
d9592d090b
commit
3125ae8339
@ -5,7 +5,7 @@
|
||||
from calibre.constants import iswindows, ismacos
|
||||
|
||||
if iswindows:
|
||||
pass
|
||||
from .windows import Client
|
||||
elif ismacos:
|
||||
pass
|
||||
else:
|
||||
|
17
src/calibre/gui2/tts/windows.py
Normal file
17
src/calibre/gui2/tts/windows.py
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
# License: GPL v3 Copyright: 2020, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
class Client:
|
||||
|
||||
def __init__(self):
|
||||
from calibre.utils.windows.winsapi import ISpVoice
|
||||
self.sp_voice = ISpVoice()
|
||||
|
||||
def __del__(self):
|
||||
self.sp_voice = None
|
||||
|
||||
def speak_simple_text(self, text):
|
||||
from calibre_extensions.winsapi import SPF_ASYNC, SPF_PURGEBEFORESPEAK, SPF_IS_NOT_XML
|
||||
self.sp_voice.speak(text, SPF_ASYNC | SPF_PURGEBEFORESPEAK | SPF_IS_NOT_XML)
|
Loading…
x
Reference in New Issue
Block a user