このコミットが含まれているのは:
2023-12-02 23:56:43 +09:00
コミット 52c862f56b
+4 -8
ファイルの表示
@@ -1,4 +1,5 @@
from ctypes import *
import subprocess
class Aques:
@@ -14,14 +15,9 @@ class Aques:
with open (phont_file, 'rb') as f:
phont = f.read ()
aqkoe = cdll.LoadLibrary ('libAqKanji2Koe.so')
dic_path: str = './aq_dic'
err = c_int (0)
aqkoe.AqKanji2Koe_Create.restype = c_void_p
handle = aqkoe.AqKanji2Koe_Create (dic_path.encode ('utf-8'), byref (err))
koe: str = ''
aqkoe.AqKanji2Koe_Convert.restype = c_int
aqkoe.AqKanji2Koe_Convert (handle, text.encode ('utf-8'), koe, 4096)
p = subprocess.Popen ('./aques', stdin = subprocess.PIPE,
stdout = subprocess.PIPE)
koe = p.communicate (text.encode ())[0].decode ()
aqtk = cdll.LoadLibrary ('libAquesTalk2Eva.so')
aqtk.AquesTalk2_Synthe_Utf8.restype = POINTER (ARRAY (c_ubyte, 0))