mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Start work on wrapping the WinRT speech APIs
They give access to more voices, but whether they will be workable remains to be seen.
This commit is contained in:
parent
ceb72752e4
commit
6dd38d512c
@ -184,6 +184,14 @@
|
||||
"libraries": "SAPI Ole32",
|
||||
"cflags": "/X"
|
||||
},
|
||||
{
|
||||
"name": "winspeech",
|
||||
"only": "windows",
|
||||
"headers": "calibre/utils/cpp_binding.h calibre/utils/windows/common.h",
|
||||
"sources": "calibre/utils/windows/winspeech.cpp",
|
||||
"libraries": "shlwapi runtimeobject",
|
||||
"cflags": "/X"
|
||||
},
|
||||
{
|
||||
"name": "wpd",
|
||||
"only": "windows",
|
||||
|
@ -261,7 +261,7 @@ class ExtDev(Command):
|
||||
try:
|
||||
path = path.format(ext)
|
||||
src = os.path.join(ext_dir, os.path.basename(path))
|
||||
subprocess.check_call(['ssh', '-S', control_path, host, 'chmod', '+w', f'"{path}"'])
|
||||
subprocess.check_call(['ssh', '-S', control_path, host, 'chmod', '+wx', f'"{path}"'])
|
||||
with open(src, 'rb') as f:
|
||||
p = subprocess.Popen(['ssh', '-S', control_path, host, f'cat - > "{path}"'], stdin=subprocess.PIPE)
|
||||
p.communicate(f.read())
|
||||
|
@ -269,7 +269,7 @@ class ExtensionsImporter:
|
||||
'uchardet',
|
||||
)
|
||||
if iswindows:
|
||||
extra = ('winutil', 'wpd', 'winfonts', 'winsapi')
|
||||
extra = ('winutil', 'wpd', 'winfonts', 'winsapi', 'winspeech')
|
||||
elif ismacos:
|
||||
extra = ('usbobserver', 'cocoa', 'libusb', 'libmtp')
|
||||
elif isfreebsd or ishaiku or islinux:
|
||||
|
32
src/calibre/utils/windows/winspeech.cpp
Normal file
32
src/calibre/utils/windows/winspeech.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* winspeech.cpp
|
||||
* Copyright (C) 2023 Kovid Goyal <kovid at kovidgoyal.net>
|
||||
*
|
||||
* Distributed under terms of the GPL3 license.
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#define M(name, args) { #name, name, args, ""}
|
||||
static PyMethodDef methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
#undef M
|
||||
|
||||
|
||||
static int
|
||||
exec_module(PyObject *m) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static PyModuleDef_Slot slots[] = { {Py_mod_exec, (void*)exec_module}, {0, NULL} };
|
||||
|
||||
static struct PyModuleDef module_def = {PyModuleDef_HEAD_INIT};
|
||||
|
||||
CALIBRE_MODINIT_FUNC PyInit_winspeech(void) {
|
||||
module_def.m_name = "winspeech";
|
||||
module_def.m_doc = "Windows Speech API wrapper";
|
||||
module_def.m_methods = methods;
|
||||
module_def.m_slots = slots;
|
||||
return PyModuleDef_Init(&module_def);
|
||||
}
|
11
src/calibre/utils/windows/winspeech.py
Normal file
11
src/calibre/utils/windows/winspeech.py
Normal file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python
|
||||
# License: GPLv3 Copyright: 2023, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
import calibre_extensions.winspeech as winspeech
|
||||
|
||||
winspeech
|
||||
|
||||
|
||||
def develop():
|
||||
pass
|
Loading…
x
Reference in New Issue
Block a user