chore: speaker is undefined

This commit is contained in:
WJG 2024-06-19 21:22:21 +08:00
parent c033235d2c
commit 974fbbf653
No known key found for this signature in database
GPG Key ID: 258474EF8590014A

View File

@ -396,7 +396,9 @@ export class BaseSpeaker {
switch (tts) {
case "custom":
const _text = encodeURIComponent(ttsText);
const url = `${process.env.TTS_BASE_URL}/tts.mp3?speaker=${speaker}&text=${_text}`;
const url = `${process.env.TTS_BASE_URL}/tts.mp3?speaker=${
speaker || ""
}&text=${_text}`;
res = await play({ url });
break;
case "xiaoai":