feat: Integrate IndexTTS2 model and update related schemas and frontend components
This commit is contained in:
@@ -573,6 +573,16 @@ async def generate_project(project_id: int, user: User, db: Session, chapter_ind
|
||||
"language": "zh",
|
||||
"instruct": _get_gendered_instruct(char.gender, design.instruct),
|
||||
})
|
||||
elif char.use_indextts2 and design.ref_audio_path and Path(design.ref_audio_path).exists():
|
||||
from core.tts_service import IndexTTS2Backend
|
||||
indextts2 = IndexTTS2Backend()
|
||||
audio_bytes = await indextts2.generate(
|
||||
text=seg.text,
|
||||
spk_audio_prompt=design.ref_audio_path,
|
||||
output_path=str(audio_path),
|
||||
emo_text=char.instruct or None,
|
||||
emo_alpha=0.6,
|
||||
)
|
||||
else:
|
||||
if design.voice_cache_id:
|
||||
from core.cache_manager import VoiceCacheManager
|
||||
|
||||
Reference in New Issue
Block a user