diff --git a/coquitts/coqui.py b/coquitts/coqui.py index b096412..5c6c0e9 100644 --- a/coquitts/coqui.py +++ b/coquitts/coqui.py @@ -4,6 +4,7 @@ from TTS.utils.synthesizer import Synthesizer import numpy as np # from logmmse import logmmse from scipy.io.wavfile import write +from appPublic.worker import awaitify from ahserver.serverenv import ServerEnv class CoquiTTS: @@ -15,7 +16,7 @@ class CoquiTTS: model_path, config_path, None, None, None, ) - def generate(self, text): + def _generate(self, text): """ wavs = self.synthesizer.tts(text) enhanced = logmmse(np.array(wavs, dtype=np.float32), @@ -36,3 +37,5 @@ class CoquiTTS: b.seek(0,0) buf = b.read() return buf + + self.generate = awaitify(self._generate)