This commit is contained in:
yumoqing 2024-01-28 11:17:41 +08:00
parent 70065b9283
commit 824f2e8b6e

View File

@ -1,3 +1,4 @@
from io import BytesIO
from TTS.utils.manage import ModelManager
from TTS.utils.synthesizer import Synthesizer
import numpy as np
@ -22,5 +23,8 @@ class TTS:
initial_noise=1,
window_size=160,
noise_threshold=0.15)
write(fn, self.synthesizer.output_sample_rate, enhanced)
return fn
b = BytesIO()
write(b, self.synthesizer.output_sample_rate, enhanced)
b.seek(0,0)
buf = b.read()
return buf