克隆文件名规范化
This commit is contained in:
parent
de304433a9
commit
98e3dd03ed
|
|
@ -270,7 +270,7 @@ async def get_voice_status(voice_id: str):
|
|||
|
||||
|
||||
# 调试端点
|
||||
@router.get("/minmax_clone/debug/env",
|
||||
@router.get("/debug/env",
|
||||
summary="调试环境变量",
|
||||
description="检查环境变量和配置状态",
|
||||
dependencies=[Depends(verify_token)])
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ def generate_unique_voice_id(prefix="minmax_audio_clone"):
|
|||
prefix: voice_id的前缀,默认为"minmax_audio_clone"
|
||||
|
||||
返回:
|
||||
符合MiniMax规则的唯一voice_id,格式:minmax_audio_clone_20250803_547218f2
|
||||
符合MiniMax规则的唯一voice_id,格式:minmax_audio_clone_20250803_5218f2
|
||||
"""
|
||||
# 获取当前日期,格式:YYYYMMDD
|
||||
current_date = datetime.now().strftime("%Y%m%d")
|
||||
|
|
@ -109,8 +109,14 @@ def voice_clone_and_download(audio_file_path, group_id, api_key, text, output_di
|
|||
if not os.path.exists(output_dir):
|
||||
os.makedirs(output_dir)
|
||||
|
||||
# 使用voice_id作为文件名
|
||||
filename = f"{voice_id}.mp3"
|
||||
# # 使用voice_id作为文件名
|
||||
# filename = f"{voice_id}.mp3"
|
||||
# output_path = os.path.join(output_dir, filename)
|
||||
|
||||
# 获取源文件名和扩展名,并添加"cloned"后缀
|
||||
source_basename = os.path.basename(audio_file_path)
|
||||
source_filename, source_extension = os.path.splitext(source_basename)
|
||||
filename = f"{source_filename}_cloned{source_extension}"
|
||||
output_path = os.path.join(output_dir, filename)
|
||||
|
||||
# 下载文件
|
||||
|
|
|
|||
Loading…
Reference in New Issue