TTS: 修正音色为stepaudio合法voice_id, 修回落格式与错误透传
This commit is contained in:
@@ -15,7 +15,7 @@ class CharacterIn(BaseModel):
|
||||
name: str
|
||||
persona: str = ""
|
||||
greeting: str = ""
|
||||
voice: str = "tongtong"
|
||||
voice: str = "elegantgentle-female"
|
||||
avatar_url: str = ""
|
||||
|
||||
|
||||
|
||||
@@ -271,11 +271,11 @@ async def tts(sid: int, mid: int, user: User = Depends(current_user),
|
||||
raise HTTPException(404, "消息不存在")
|
||||
client, models = await _channel_for(db, user, s)
|
||||
model = models.get("tts") or "stepaudio-2.5-tts"
|
||||
voice = "tongtong"
|
||||
voice = "elegantgentle-female"
|
||||
if s.character_id:
|
||||
ch = await db.get(Character, s.character_id)
|
||||
if ch:
|
||||
voice = ch.voice
|
||||
if ch and ch.voice:
|
||||
voice = ch.voice # 非法音色由 client.fix_voice 兜底
|
||||
try:
|
||||
audio = await client.tts(model, _dec(user, m.content_enc), voice)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user