main
yumoqing 2024-02-21 15:27:31 +08:00
parent a460bf4824
commit c2bc2fcc8c
1 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import asyncio
from io import BytesIO
from TTS.utils.manage import ModelManager
from TTS.utils.synthesizer import Synthesizer
@ -38,4 +39,7 @@ class CoquiTTS:
buf = b.read()
return buf
generate = awaitify(_generate)
async def generate(self, text):
w = asyncio.create_task(self._generate(text))
await asyncio.wait(w)