Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/commands/src/commands/config/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const UI_MODEL_DEFAULTS: Record<string, string> = {
default_video_model: "wan3.0-video",
default_image_to_video_model: "wan3.0-video",
default_reference_to_video_model: "wan3.0-video",
default_speech_model: "cosyvoice-v3-flash",
default_speech_model: "qwen-audio-3.1-tts-flash",
default_speech_recognition_model: "fun-asr",
default_omni_model: "qwen3.8-omni-flash",
};
Expand Down Expand Up @@ -123,8 +123,10 @@ export const UI_MODEL_CATALOG: Record<string, ModelOption[]> = {
{ id: "happyhorse-1.1-r2v", role: "video/ref · reference-to-video" },
],
default_speech_model: [
{ id: "cosyvoice-v3-flash", role: "speech/synthesize (TTS) default" },
{ id: "qwen-audio-3.0-tts-plus", role: "Token Plan speech/synthesize (TTS)" },
{ id: "qwen-audio-3.1-tts-flash", role: "speech/synthesize (TTS) default · not Token Plan" },
{ id: "qwen-audio-3.1-tts-plus", role: "speech/synthesize (TTS) · not Token Plan" },
{ id: "cosyvoice-v3-flash", role: "speech/synthesize (TTS) · not Token Plan" },
{ id: "qwen-audio-3.0-tts-plus", role: "Token Plan speech/synthesize (TTS) only" },
],
default_speech_recognition_model: [
{ id: "fun-asr", role: "speech/recognize (ASR) default" },
Expand Down
75 changes: 67 additions & 8 deletions packages/commands/src/commands/speech/synthesize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,43 @@ interface VoiceEntry {
lang: string;
}

// qwen-audio-3.1-tts-plus system voices (official docs list only these four)
const QWEN_AUDIO_31_TTS_PLUS_VOICES: VoiceEntry[] = [
{ voice: "longanlingxin_v3.1", name: "龙安灵心", desc: "知心温暖音", lang: "中文/英文" },
{ voice: "xunanchuan_v3.1", name: "许南川", desc: "沉稳男声", lang: "中文/英文" },
{ voice: "longanhuan_v3.1", name: "龙安欢", desc: "欢脱元气女", lang: "中文/英文" },
{ voice: "longanfengyue_v3.1", name: "龙安风悦", desc: "自然亲切音", lang: "中文/英文" },
];

// qwen-audio-3.1-tts-flash system voices (curated; full list via docs URL)
const QWEN_AUDIO_31_TTS_FLASH_VOICES: VoiceEntry[] = [
// Multilingual / dialect
{ voice: "longanlingxin_v3.1", name: "龙安灵心", desc: "知心温暖音", lang: "中文/英文" },
{ voice: "xunanchuan_v3.1", name: "许南川", desc: "沉稳男声", lang: "中文/英文" },
{ voice: "longanhuan_v3.1", name: "龙安欢", desc: "欢脱元气女", lang: "中文/英文" },
{ voice: "longanfengyue_v3.1", name: "龙安风悦", desc: "自然亲切音", lang: "中文/英文" },
// Social companion (premium Chinese)
{ voice: "longanyuanfei_v3.1", name: "龙安元妃", desc: "高傲妃子音", lang: "中文" },
{ voice: "longanlingxi_v3.1", name: "龙安灵希", desc: "可爱甜美音", lang: "中文" },
{ voice: "longanyang_v3.1", name: "龙安洋", desc: "阳光大男孩", lang: "中文" },
{ voice: "longfeifei_v3.1", name: "龙菲菲", desc: "甜美娇气女", lang: "中文" },
{ voice: "longyan_v3.1", name: "龙颜", desc: "温暖春风女", lang: "中文" },
{ voice: "longcheng_v3.1", name: "龙橙", desc: "智慧青年男", lang: "中文" },
{ voice: "longze_v3.1", name: "龙泽", desc: "温暖元气男", lang: "中文" },
// Kids / toys
{ voice: "longjielidou_v3.1", name: "龙杰力豆", desc: "天真男童", lang: "中文" },
{ voice: "longpaopao_v3.1", name: "龙泡泡", desc: "软糯可爱音", lang: "中文" },
{ voice: "longke_v3.1", name: "龙可", desc: "懵懂童声", lang: "中文" },
// Character / game
{ voice: "longhuohuo_v3.1", name: "龙火火", desc: "顽皮少年音", lang: "中文" },
// English
{ voice: "loongbella_v3.1", name: "Bella", desc: "干练知性女", lang: "中文/英文" },
{ voice: "Emily_v3.1", name: "Emily", desc: "英式女声", lang: "英文" },
{ voice: "Eric_v3.1", name: "Eric", desc: "英式男声", lang: "英文" },
{ voice: "Abby_v3.1", name: "Abby", desc: "美式女声", lang: "英文" },
{ voice: "Andy_v3.1", name: "Andy", desc: "美式男声", lang: "英文" },
];

// qwen-audio-3.0-tts-plus system voices (official docs list only these two)
const QWEN_AUDIO_30_TTS_PLUS_VOICES: VoiceEntry[] = [
{ voice: "longanlingxin", name: "龙安灵心", desc: "知心温暖音", lang: "中文/英文" },
Expand Down Expand Up @@ -150,6 +187,8 @@ const COSYVOICE_V3_FLASH_VOICES: VoiceEntry[] = [
];

const MODEL_VOICES: Record<string, VoiceEntry[]> = {
"qwen-audio-3.1-tts-flash": QWEN_AUDIO_31_TTS_FLASH_VOICES,
"qwen-audio-3.1-tts-plus": QWEN_AUDIO_31_TTS_PLUS_VOICES,
"qwen-audio-3.0-tts-plus": QWEN_AUDIO_30_TTS_PLUS_VOICES,
"qwen-audio-3.0-tts-flash": QWEN_AUDIO_30_TTS_FLASH_VOICES,
"cosyvoice-v3-flash": COSYVOICE_V3_FLASH_VOICES,
Expand Down Expand Up @@ -261,19 +300,19 @@ const SYNTHESIZE_FLAGS = {
valueHint: "<model>",
description: {
"en-US":
"Model ID (default: configured Profile TTS model, otherwise cosyvoice-v3-flash). System voices vary by model",
"Model ID (default: configured Profile TTS model, otherwise qwen-audio-3.1-tts-flash). System voices vary by model",
"zh-CN":
"模型 ID(默认:Profile 配置的 TTS 模型,否则为 cosyvoice-v3-flash)。系统音色因模型而异",
"模型 ID(默认:Profile 配置的 TTS 模型,否则为 qwen-audio-3.1-tts-flash)。系统音色因模型而异",
},
},
voice: {
type: "string",
valueHint: "<voice>",
description: {
"en-US":
"Voice ID. Use --list-voices for the selected model (e.g. qwen-audio-3.0-tts-plus/flash, cosyvoice-v3-flash); for v3.5-flash provide a clone/design voice ID",
"Voice ID. Use --list-voices for the selected model (e.g. qwen-audio-3.1-tts-flash/plus, qwen-audio-3.0-tts-plus/flash, cosyvoice-v3-flash); for v3.5-flash provide a clone/design voice ID",
"zh-CN":
"音色 ID。使用 --list-voices 查看所选模型的内置音色(如 qwen-audio-3.0-tts-plus/flash、cosyvoice-v3-flash);使用 v3.5-flash 时需提供复刻/设计音色 ID",
"音色 ID。使用 --list-voices 查看所选模型的内置音色(如 qwen-audio-3.1-tts-flash/plus、qwen-audio-3.0-tts-plus/flash、cosyvoice-v3-flash);使用 v3.5-flash 时需提供复刻/设计音色 ID",
},
},
listVoices: {
Expand Down Expand Up @@ -384,11 +423,25 @@ export default defineCommand({
usageArgs: "--text <text> [flags]",
flags: SYNTHESIZE_FLAGS,
exampleArgs: [
"--list-voices --model qwen-audio-3.0-tts-plus",
{
"en-US": "# Ordinary API Key",
"zh-CN": "# 普通 API Key",
},
"--list-voices --model qwen-audio-3.1-tts-flash",
"--list-voices --model cosyvoice-v3-flash",
{
"en-US": '--text "Hello, I am Qwen" --model qwen-audio-3.0-tts-plus --voice longanlingxin',
"zh-CN": '--text "你好,我是通义千问" --model qwen-audio-3.0-tts-plus --voice longanlingxin',
"en-US":
'--text "Hello, I am Qwen" --model qwen-audio-3.1-tts-flash --voice longanlingxin_v3.1',
"zh-CN":
'--text "你好,我是通义千问" --model qwen-audio-3.1-tts-flash --voice longanlingxin_v3.1',
},
{
"en-US": "# Token Plan (omit --model to use Profile default qwen-audio-3.0-tts-plus)",
"zh-CN": "# Token Plan(省略 --model,使用 Profile 默认 qwen-audio-3.0-tts-plus)",
},
{
"en-US": '--text "Hello, I am Qwen" --voice longanlingxin',
"zh-CN": '--text "你好,我是通义千问" --voice longanlingxin',
},
{
"en-US": '--text "Hello world" --voice <voice_id> --language en',
Expand Down Expand Up @@ -423,6 +476,12 @@ export default defineCommand({
},
],
notes: [
{
"en-US":
"Built-in default (when --model and Profile default_speech_model are both unset) is qwen-audio-3.1-tts-flash. Voice IDs are model-specific: keep CosyVoice voices such as longanyang only with --model cosyvoice-v3-flash; for the new default use matching IDs (e.g. longanlingxin_v3.1) via --list-voices.",
"zh-CN":
"未传 --model 且 Profile 未配置 default_speech_model 时,内置默认为 qwen-audio-3.1-tts-flash。音色 ID 与模型绑定:继续使用 CosyVoice 旧音色(如 longanyang)时请显式加 --model cosyvoice-v3-flash;使用新默认时请用匹配音色(如 longanlingxin_v3.1,可用 --list-voices 查看)。",
},
{
"en-US":
'Model "auto" (via --model auto or a config default model of "auto") routes to the official Bailian MCP with a reduced parameter set; MCP-incompatible flags fail fast with a usage error instead of falling back to REST.',
Expand All @@ -446,7 +505,7 @@ export default defineCommand({
return;
}

const model = resolvedModel || "cosyvoice-v3-flash";
const model = resolvedModel || "qwen-audio-3.1-tts-flash";

// --list-voices: print voice list for the model and exit
if (flags.listVoices) {
Expand Down
15 changes: 15 additions & 0 deletions packages/commands/tests/e2e/speech-list-voices.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ describe("e2e: speech list-voices", () => {
});

// --list-voices 只读本地目录,但 auth: apiKey 在 run() 前仍要求凭证
test("【qwen-audio-3.1-tts-flash】获取音色列表", async () => {
const { stdout, stderr, exitCode } = await runCommandE2e(SPEECH_ROUTES, [
"speech",
"synthesize",
"--list-voices",
"--model",
"qwen-audio-3.1-tts-flash",
"--api-key",
"sk-e2e-placeholder",
]);
expect(exitCode, stderr).toBe(0);
expect(stdout).toContain("longanlingxin_v3.1");
expect(stdout).toContain("xunanchuan_v3.1");
});

test("【qwen-audio-3.0-tts-plus】获取音色列表", async () => {
const { stdout, stderr, exitCode } = await runCommandE2e(SPEECH_ROUTES, [
"speech",
Expand Down
66 changes: 66 additions & 0 deletions packages/commands/tests/e2e/speech-synthesize.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,49 @@ describe("e2e: speech synthesize", () => {
expect(data.request?.input?.format).toBe("mp3");
});

// No --model and Profile without default_speech_model → built-in fallback.
test("未传 --model 且 Profile 未配置 TTS 默认时解析为 qwen-audio-3.1-tts-flash", async () => {
const configDir = makeE2eOutputDir("speech-synthesize-builtin-fallback");
writeFileSync(
join(configDir, "config.json"),
JSON.stringify({
default: {
api_key: "sk-e2e-placeholder",
},
}),
);

const { stdout, stderr, exitCode } = await runCommandE2e(
SPEECH_ROUTES,
[
"speech",
"synthesize",
"--config",
"default",
"--voice",
"longanlingxin_v3.1",
"--text",
"内置 TTS 默认模型测试",
"--dry-run",
"--output",
"json",
"--quiet",
],
{
BAILIAN_CONFIG_DIR: configDir,
DASHSCOPE_API_KEY: "",
DASHSCOPE_BASE_URL: "",
},
);

expect(exitCode, stderr).toBe(0);
const data = parseStdoutJson<{
request?: { model?: string; input?: { voice?: string } };
}>(stdout);
expect(data.request?.model).toBe("qwen-audio-3.1-tts-flash");
expect(data.request?.input?.voice).toBe("longanlingxin_v3.1");
});

test("speech synthesize 流式模式未显式传 format 时保持 PCM", async () => {
const { stdout, stderr, exitCode } = await runCommandE2e(SPEECH_ROUTES, [
"speech",
Expand Down Expand Up @@ -154,5 +197,28 @@ describe.skipIf(!isBailianE2EMediaEnabled() || !isDashScopeE2EReady())(
expect(data.saved).toBe(outMp3);
expect(data.audio_url?.length ?? 0).toBeGreaterThan(0);
}, 180_000);

test("【qwen-audio-3.1-tts-flash】语音合成", async () => {
const outDir = makeE2eOutputDir("speech-synthesize-qwen-audio-31-flash");
const outMp3 = join(outDir, "e2e-tts-3.1-flash.mp3");
const { stdout, stderr, exitCode } = await runCommandE2e(SPEECH_ROUTES, [
"speech",
"synthesize",
"--model",
"qwen-audio-3.1-tts-flash",
"--voice",
"longanlingxin_v3.1",
"--text",
"端到端语音测试",
"--out",
outMp3,
"--output",
"json",
]);
expect(exitCode, stderr).toBe(0);
const data = parseStdoutJson<{ saved?: string; audio_url?: string }>(stdout);
expect(data.saved).toBe(outMp3);
expect(data.audio_url?.length ?? 0).toBeGreaterThan(0);
}, 180_000);
},
);
71 changes: 45 additions & 26 deletions packages/commands/tests/output/speech-synthesize-output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,32 +282,51 @@ test("stream dry-run still allows JSON preview without --out", async () => {
expect(requests).toEqual([]);
expect(result.stderr).toBe("");
});
test.each(["qwen-audio-3.0-tts-plus", "cosyvoice-v3.5-flash", "unknown-model"])(
"voice list returns one JSON result for %s",
async (model) => {
const result = await invoke({ listVoices: true, model }, { format: "json", quiet: true });
expect(result.exitCode).toBe(0);
const data = JSON.parse(result.stdout);
expect(data.model).toBe(model);
expect(data.voice_list_url).toBeTypeOf("string");
if (model === "unknown-model") {
expect(data.voices).toBeNull();
expect(data.total).toBeNull();
} else if (model === "cosyvoice-v3.5-flash") {
expect(data.voices).toEqual([]);
expect(data.total).toBe(0);
expect(data.clone_design_docs_url).toBeTypeOf("string");
} else {
expect(data.total).toBe(2);
expect(data.voices.map((entry: { voice: string }) => entry.voice)).toEqual([
"longanlingxin",
"longanlufeng",
]);
}
expect(requests).toEqual([]);
expect(result.stderr).toBe("");
},
);
test.each([
"qwen-audio-3.1-tts-flash",
"qwen-audio-3.1-tts-plus",
"qwen-audio-3.0-tts-plus",
"cosyvoice-v3.5-flash",
"unknown-model",
])("voice list returns one JSON result for %s", async (model) => {
const result = await invoke({ listVoices: true, model }, { format: "json", quiet: true });
expect(result.exitCode).toBe(0);
const data = JSON.parse(result.stdout);
expect(data.model).toBe(model);
expect(data.voice_list_url).toBeTypeOf("string");
if (model === "unknown-model") {
expect(data.voices).toBeNull();
expect(data.total).toBeNull();
} else if (model === "cosyvoice-v3.5-flash") {
expect(data.voices).toEqual([]);
expect(data.total).toBe(0);
expect(data.clone_design_docs_url).toBeTypeOf("string");
} else if (model === "qwen-audio-3.1-tts-flash") {
expect(data.total).toBe(20);
expect(data.voices.map((entry: { voice: string }) => entry.voice).slice(0, 4)).toEqual([
"longanlingxin_v3.1",
"xunanchuan_v3.1",
"longanhuan_v3.1",
"longanfengyue_v3.1",
]);
} else if (model === "qwen-audio-3.1-tts-plus") {
expect(data.total).toBe(4);
expect(data.voices.map((entry: { voice: string }) => entry.voice)).toEqual([
"longanlingxin_v3.1",
"xunanchuan_v3.1",
"longanhuan_v3.1",
"longanfengyue_v3.1",
]);
} else {
expect(data.total).toBe(2);
expect(data.voices.map((entry: { voice: string }) => entry.voice)).toEqual([
"longanlingxin",
"longanlufeng",
]);
}
expect(requests).toEqual([]);
expect(result.stderr).toBe("");
});
test.each(["submit", "empty", "download"] as const)(
"nonstream %s failure retains one JSON error",
async (mode) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/pipeline/steps/bl-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ export async function speechSynthesize(
});
}

const model = input.model || "cosyvoice-v3-flash";
const model = input.model || "qwen-audio-3.1-tts-flash";

const body: DashScopeTTSRequest = {
model,
Expand Down
6 changes: 5 additions & 1 deletion skills/bailian-gen/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ BAILIAN_CALLER_TYPE=agent BAILIAN_CALLER_NAME=codex BAILIAN_SKILL_NAME=bailian-g
| Text-to-video / image-to-video | `bl video generate` | `wan3.0-video` |
| Video edit / style transfer | `bl video edit` | `happyhorse-1.0-video-edit` |
| Reference-to-video + voice | `bl video ref` | `wan3.0-video` |
| Speech synthesis (TTS / voiceover) | `bl speech synthesize` | `cosyvoice-v3-flash` |
| Speech synthesis (TTS / voiceover) | `bl speech synthesize` | API Key: `qwen-audio-3.1-tts-flash`; Token Plan: `qwen-audio-3.0-tts-plus` only (3.1 not supported) |
| Voice clone / manage | `bl speech voice clone/list/get/update/delete/preview` | CosyVoice/Qwen-Audio: `voice-enrollment` → `speech synthesize --model`. Omni (non-realtime flash/plus only): `qwen-voice-enrollment` create/list/delete → `omni --model <same-target-model> --voice` |
| Voice design from text | `bl speech voice design` | `voice-enrollment` → preview saved locally; formal listen via `speech synthesize` (not for Omni targets) |
| Audio content generation (podcast/dialogue) | `bl speech generate` | `qwen-audio-3.1-tts-next` (text_prompt/references; not voice IDs) |
Expand All @@ -55,6 +55,10 @@ BAILIAN_CALLER_TYPE=agent BAILIAN_CALLER_NAME=codex BAILIAN_SKILL_NAME=bailian-g

Unless the user explicitly specifies a model, omit `--model` and let the CLI use the active Profile’s default.

TTS migration: the built-in synthesize default is `qwen-audio-3.1-tts-flash`. CosyVoice voice IDs (e.g. `longanyang`) are not valid for that model — keep them only with explicit `--model cosyvoice-v3-flash`, or switch to matching 3.1 IDs (e.g. `longanlingxin_v3.1`; use `--list-voices`).

Token Plan TTS: keep Profile `default_speech_model` (`qwen-audio-3.0-tts-plus`) — omit `--model`. Do **not** pass `qwen-audio-3.1-tts-flash` or `qwen-audio-3.1-tts-plus`; Token Plan does not support those models.

For ASR model selection, keep `fun-asr` (or other `*-filetrans`) for long recordings, repeated files, speaker diarization, or asynchronous task IDs. For one local or remote audio file up to about five minutes when the user asks for low-latency Flash models, use `--model fun-asr-flash-2026-06-15`, `--model qwen-audio-3.0-asr-flash`, or `--model qwen3-asr-flash`. Flash recognition is synchronous and accepts exactly one file per call.

Voice clone vs design vs generate:
Expand Down
Loading