issues/608

Update NeoSpeech.py
This commit is contained in:
恍兮惚兮 2024-03-28 00:53:23 +08:00
parent a3ee1e482d
commit 8c367a3994
2 changed files with 6 additions and 2 deletions

View File

@ -17,7 +17,10 @@ def sqlite2json2(self,sqlitefile,targetjson=None,existsmerge=False):
for _aret in ret: for _aret in ret:
if len(_aret)==4: if len(_aret)==4:
_id,source_parsed,mt,source=_aret _id,source,mt,source_origin=_aret
if targetjson:
source=source_origin
js_format2[source]=mt js_format2[source]=mt
elif len(_aret)==3: elif len(_aret)==3:
_id,source,mt =_aret _id,source,mt =_aret

View File

@ -65,7 +65,8 @@ class TTS(TTSbase):
def speak(self,content,rate,voice,voice_idx): def speak(self,content,rate,voice,voice_idx):
self.checkchange() self.checkchange()
windows.WriteFile(self.hPipe,bytes(ctypes.c_uint(rate))) windows.WriteFile(self.hPipe,bytes(ctypes.c_uint(rate)))
windows.WriteFile(self.hPipe,content.encode('utf-16-le')) buf=ctypes.create_unicode_buffer(content,10000)
windows.WriteFile(self.hPipe,bytes(buf))
fname=windows.ReadFile(self.hPipe,1024,None).decode('utf-16-le') fname=windows.ReadFile(self.hPipe,1024,None).decode('utf-16-le')
if os.path.exists(fname): if os.path.exists(fname):
return(fname) return(fname)