23 lines
585 B
Python
23 lines
585 B
Python
|
|
from app.dependencies.logger import get_logger
|
|
from config import get_config
|
|
|
|
logger = get_logger()
|
|
Config = get_config()
|
|
|
|
from utils.tts.openvoice_utils import TextToSpeech
|
|
openvoice_tts = TextToSpeech(use_tone_convert=True,device='cuda')
|
|
logger.info("TTS_OPENVOICE 初始化成功")
|
|
|
|
from utils.tts.vits_utils import TextToSpeech
|
|
vits_tts = TextToSpeech()
|
|
logger.info("TTS_VITS 初始化成功")
|
|
|
|
|
|
|
|
#初始化全局tts对象
|
|
def get_tts(tts_type=Config.TTS_UTILS):
|
|
if tts_type == "OPENVOICE":
|
|
return openvoice_tts
|
|
elif tts_type == "VITS":
|
|
return vits_tts |