mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
add: 部署文件
This commit is contained in:
parent
01f34bf5fa
commit
c194c39667
1 changed files with 73 additions and 69 deletions
|
|
@ -6,6 +6,7 @@ import json
|
||||||
import queue
|
import queue
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
import uuid
|
import uuid
|
||||||
import base64
|
import base64
|
||||||
import wave
|
import wave
|
||||||
|
|
@ -254,7 +255,7 @@ class FishSpeech_TTS(TTS):
|
||||||
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
return os.path.join(self.output_file, f"tts-{datetime.now().date()}@{uuid.uuid4().hex}{extension}")
|
||||||
|
|
||||||
async def text_to_speak_queue(self, text, queue: queue.Queue):
|
async def text_to_speak_queue(self, text, queue: queue.Queue):
|
||||||
|
try:
|
||||||
idstr = None
|
idstr = None
|
||||||
# priority: ref_id > [{text, audio},...]
|
# priority: ref_id > [{text, audio},...]
|
||||||
if idstr is None:
|
if idstr is None:
|
||||||
|
|
@ -333,6 +334,9 @@ class FishSpeech_TTS(TTS):
|
||||||
"data": None,
|
"data": None,
|
||||||
"end": True
|
"end": True
|
||||||
})
|
})
|
||||||
|
except Exception as e:
|
||||||
|
print(f"请求tts-fishspeech发生错误: {e}")
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
async def text_to_speak(self, text, output_file):
|
async def text_to_speak(self, text, output_file):
|
||||||
raise "不支持"
|
raise "不支持"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue