'commit'
This commit is contained in:
@@ -19,7 +19,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
|
||||
from Config.Config import XF_APPID, XF_APIKEY, XF_APISECRET
|
||||
|
||||
@router.post("/save-audio")
|
||||
async def save_audio(audio: UploadFile = File(...), txt: str = Form(...)):
|
||||
async def save_audio(audio: UploadFile = File(...), txt: str = Form(...), language: str = Form("english")): # 添加语言参数,默认英文
|
||||
"""保存音频文件并评分"""
|
||||
temp_file = None
|
||||
try:
|
||||
@@ -59,8 +59,8 @@ async def save_audio(audio: UploadFile = File(...), txt: str = Form(...)):
|
||||
appid=XF_APPID,
|
||||
api_key=XF_APIKEY,
|
||||
api_secret=XF_APISECRET,
|
||||
audio_file=mp3_temp_file, # 使用转换后的mp3文件
|
||||
language="english",
|
||||
audio_file=mp3_temp_file,
|
||||
language=language, # 使用动态参数
|
||||
txt=txt
|
||||
)
|
||||
results, eval_time = evaluator.run_evaluation()
|
||||
|
Reference in New Issue
Block a user