|
@@ -89,10 +89,13 @@ export class AliyunTtsProvider implements ITtsProvider {
|
|
|
if (isCosyVoice) {
|
|
if (isCosyVoice) {
|
|
|
requestBody.input.format = 'mp3';
|
|
requestBody.input.format = 'mp3';
|
|
|
requestBody.input.sample_rate = 48000;
|
|
requestBody.input.sample_rate = 48000;
|
|
|
- // CosyVoice v3-flash 系统音色支持 Instruct 情感控制(官方格式:你说话的情感是<值>。)
|
|
|
|
|
- if ((params as any).instructText) {
|
|
|
|
|
- requestBody.input.instruction = (params as any).instructText;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 修复 #tts-cosyvoice-428: cosyvoice-v3-flash 的 SpeechSynthesizer 接口
|
|
|
|
|
+ // 不接受 instruction 字段,任何带 instruction 的请求都返回
|
|
|
|
|
+ // 400 InvalidParameter (Engine return error code: 428),
|
|
|
|
|
+ // 连官方宣称支持 Instruct 的音色(longanhuan_v3 等)也一样。
|
|
|
|
|
+ // 实测:纯净请求 200,带 instruction 100% 失败。
|
|
|
|
|
+ // 因此 cosyvoice 不注入 instruction —— 情感控制改由 qwen3-tts-instruct 承担。
|
|
|
|
|
+ // (如需在 cosyvoice 上做情感,应改用 WebSocket streaming 接口,而非此同步接口)
|
|
|
}
|
|
}
|
|
|
if (!isCosyVoice && activeModel.includes('instruct')) {
|
|
if (!isCosyVoice && activeModel.includes('instruct')) {
|
|
|
const instructions: string[] = [];
|
|
const instructions: string[] = [];
|