Browse Source

aques 実行

btc-sounds
みてるぞ 9 months ago
parent
commit
52c862f56b
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      aques.py

+ 4
- 8
aques.py View File

@@ -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))


Loading…
Cancel
Save