Skip to content

fix: change default Xunfei TTS voice to authorized x4_xiaoyan#13

Merged
ailuckly merged 1 commit into
developfrom
feat/realtime-voice-stt-p0-p1
Apr 12, 2026
Merged

fix: change default Xunfei TTS voice to authorized x4_xiaoyan#13
ailuckly merged 1 commit into
developfrom
feat/realtime-voice-stt-p0-p1

Conversation

@ailuckly
Copy link
Copy Markdown
Owner

The previous default x4_lingxiaoyu_emo was not authorized in the Xunfei console, causing TTS API error 11200 (licc failed).

📌 变更内容

  • 如:新增用户登录 API
  • 如:修复登录失败时错误提示

✅ 测试验证

  • 本地运行通过
  • 自测通过
  • CI 流水线通过

PR 提交规范提醒:

  • 确保提交主题信息符合约定式提交规范 (feat/fix/docs/style/refactor/test/chore)
  • 确保代码已经通过本地测试
  • 确保没有提交敏感信息(密码、密钥等)

The previous default x4_lingxiaoyu_emo was not authorized in the
Xunfei console, causing TTS API error 11200 (licc failed).
Copilot AI review requested due to automatic review settings April 12, 2026 02:50
@ailuckly ailuckly merged commit f204a66 into develop Apr 12, 2026
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the default Xunfei (iFlytek) TTS voice to an authorized voice ID to prevent API failures when no voice is provided.

Changes:

  • Change the default fallback voice from x4_lingxiaoyu_emo to x4_xiaoyan.
  • Update the warning log message to reflect the new default voice ID.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 212 to +214
// 如果传入的音色ID不被支持,使用默认音色
logger.warn("不支持的音色ID: {},使用默认音色: xiaoyan", voiceId);
return "x4_lingxiaoyu_emo";
logger.warn("不支持的音色ID: {},使用默认音色: x4_xiaoyan", voiceId);
return "x4_xiaoyan";
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认音色ID字符串在该方法里重复了多处(返回值与 warn 文案)。建议提取成单一常量(例如 DEFAULT_VOICE_ID)并在 log/return 处统一引用,避免后续再次调整默认音色时出现日志与实际默认值不一致。

Copilot uses AI. Check for mistakes.
@@ -199,7 +199,7 @@ private Flux<TtsResult> synthesizeSingleTextWithResult(String text, TtsConfig co
*/
private String getXunfeiVoiceId(String voiceId) {
if (voiceId == null || voiceId.isEmpty()) {
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

voiceId 这里只判断了 isEmpty();如果配置传入的是仅包含空白字符(例如" "),会被当作“不支持的音色”走 warn + fallback。仓库里对字符串空值更常用 trim().isEmpty()(本文件里对 text 也这么做),建议将此处改为对空白同样视为未传入,从而直接使用默认音色且避免无意义的 warn。

Suggested change
if (voiceId == null || voiceId.isEmpty()) {
if (voiceId == null || voiceId.trim().isEmpty()) {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants