1. Added multi-language support to the UI

2. Optimized the voice name
3. Other UI optimizations
This commit is contained in:
harry
2024-03-29 17:13:25 +08:00
parent a7ba661053
commit bc8e005f59
6 changed files with 1293 additions and 137 deletions

View File

@@ -6,24 +6,11 @@ from os import path
from loguru import logger
from app.config import config
from app.models.schema import VideoParams, VoiceNames, VideoConcatMode
from app.models.schema import VideoParams, VideoConcatMode
from app.services import llm, material, voice, video, subtitle
from app.utils import utils
def _parse_voice(name: str):
# "female-zh-CN-XiaoxiaoNeural",
# remove first part split by "-"
if name not in VoiceNames:
name = VoiceNames[0]
parts = name.split("-")
_lang = f"{parts[1]}-{parts[2]}"
_voice = f"{_lang}-{parts[3]}"
return _voice, _lang
def start(task_id, params: VideoParams):
"""
{
@@ -40,7 +27,7 @@ def start(task_id, params: VideoParams):
"""
logger.info(f"start task: {task_id}")
video_subject = params.video_subject
voice_name, language = _parse_voice(params.voice_name)
voice_name = voice.parse_voice_name(params.voice_name)
paragraph_number = params.paragraph_number
n_threads = params.n_threads
max_clip_duration = params.video_clip_duration

File diff suppressed because it is too large Load Diff