mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Speak aloud implementation for macOS
This commit is contained in:
parent
084de4c88d
commit
a83ea13162
@ -7,7 +7,7 @@ from calibre.constants import iswindows, ismacos
|
||||
if iswindows:
|
||||
from .windows import Client
|
||||
elif ismacos:
|
||||
pass
|
||||
from .macos import Client
|
||||
else:
|
||||
from .linux import Client
|
||||
Client
|
||||
Client
|
||||
|
16
src/calibre/gui2/tts/macos.py
Normal file
16
src/calibre/gui2/tts/macos.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/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_extensions.cocoa import NSSpeechSynthesizer
|
||||
self.nsss = NSSpeechSynthesizer()
|
||||
|
||||
def __del__(self):
|
||||
self.nsss = None
|
||||
|
||||
def speak_simple_text(self, text):
|
||||
self.nsss.speak(text)
|
Loading…
x
Reference in New Issue
Block a user