update:优化

This commit is contained in:
hrz
2025-05-25 08:56:58 +08:00
parent 7a598d5839
commit 40632019ac
4 changed files with 28 additions and 18 deletions
@@ -40,17 +40,6 @@ class TTSProviderBase(ABC):
pass
def to_tts(self, text, index):
"""如果是流式实现,一般没有文件生成,我们返回枚举值"""
if self.interface_type != TTSImplementationType.NON_STREAMING:
if index == 1:
future = asyncio.run_coroutine_threadsafe(
self.start_session(self.conn.session_id), loop=self.conn.loop
)
future.result()
asyncio.run(self.text_to_speak(text, None))
return self.interface_type.value
"""以下是非流式实现,会返回文件"""
tmp_file = self.generate_filename()
try:
max_repeat_time = 5