fix(voice): 修复 MiMo TTS 无效音色与 TTS 配置后未自动激活、添加流式低延迟输出 - #331
Merged
jubaoliang merged 1 commit intoAug 19, 2026
Conversation
…o-activate
1. TTS providers now auto-activate after configuration when the active
TTS is still "browser", mirroring the existing STT behavior.
2. Remove the invalid "mimo_default" voice option (not a valid MiMo
preset voice ID). The UI defaults to 冰糖; the backend maps legacy
"mimo_default" configs to 冰糖 so existing setups keep working.
3. MiMo TTS low-latency streaming end to end:
- Backend: request pcm16 + stream, parse SSE audio chunks and wrap
them in a live WAV container (24kHz PCM16LE mono)
- Router: return audio/wav for mimo, audio/mpeg otherwise
- Frontend: stream the response via requestStream and play chunks
incrementally with WebAudio (WavStreamPlayer), falling back to the
buffered blob path for non-WAV providers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
问题与修复
TTS 配置后未自动设为当前:STT 配置完成后会自动激活,TTS 却不会,
行为不对称。现与 STT 对齐——配置 TTS 提供商后,若当前仍为 browser 则自动切换。
无效音色 mimo_default:该 ID 并非官方预置音色(V2 时代概念,V2.5 已按
集群映射为冰糖/Mia),实际请求会报 invalid voice。UI 下拉框已移除并默认
「冰糖」;后端将存量 mimo_default 配置自动映射为冰糖,旧配置无需改动。
MiMo TTS 需等待整段合成完才出声:原实现为非流式请求 + 前端整包缓冲,
长文本延迟数秒。现全链路流式:
流式 WAV(24kHz PCM16LE 单声道)
非 WAV 提供商自动回落原缓冲路径,OpenAI/腾讯云/Edge 行为不变
测试
Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
make allpasses locallyChecklist
CHANGELOG.md(if user-facing)