@vibedev-si/dsh-vibedev 0.11.4 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/lib/audio/request.d.ts +18 -0
- package/lib/index.js +43 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,23 @@
|
|
|
10
10
|
|
|
11
11
|
本插件由 `dsh-media` 改名而来,见下面的「从 dsh-media 升级」。
|
|
12
12
|
|
|
13
|
+
## 0.11.6 用户可见更新
|
|
14
|
+
|
|
15
|
+
**配音尽量一次生成**:实测同一模型读同一句话,两次生成的时长可以差 2 秒(3.3 秒对 5.3 秒),语速和停顿波动很大。用多次独立调用拼接长旁白时,即使音色一致,节奏也会一段一段不一样。`audio_generate` 的说明(英文,给模型看)现在提醒 Agent:
|
|
16
|
+
|
|
17
|
+
> 同一批配音请尽量一次性连续生成,避免拆成多次独立调用:同一模型对同一段文本的语速和停顿波动较大(实测两次可相差 2 秒),多次调用拼接会导致节奏不一致。确需分段时,请保持相同的参考音频、相同的格式与采样率,并把各段放在同一次任务里连续提交。
|
|
18
|
+
|
|
19
|
+
`prompt`(语音)参数也加了一句:长旁白优先一次生成;必须分段时保持同一组 references 与相同格式。0.11.5 的 `@AudioN` 自动标记已在真机验证:不会念出标记、内容完整,行为不变。
|
|
20
|
+
|
|
21
|
+
## 0.11.5 用户可见更新
|
|
22
|
+
|
|
23
|
+
**语音合成的参考音频终于生效了**:之前传了参考音频,生成出来却总是默认音色,分段生成时每段听起来像不同的人。原因是 Seed Audio 1.0 只认文本里用 `@Audio1` / `@Audio2` / `@Audio3` 点名的参考音频(`references[0]` 对应 `@Audio1`,按上传顺序,最多 3 个),网关不会替我们加这些标记。
|
|
24
|
+
|
|
25
|
+
- **自动加标记**:语音请求带了参考音频、而文本里没有任何 `@AudioN` 时,插件会在发出的文本开头加上 `@Audio1 @Audio2 …`(有几个参考加几个,最多 3 个)。文本里已经写了标记就原样发送。只改发给网关的请求体,你写的原文、会话记录都不变。音乐和播客不受影响。
|
|
26
|
+
- **多角色对白**:每个角色传一个参考音频,在文本里用标记指定谁读哪段,例如 `@Audio1 今天天气真好。@Audio2 是啊,出去走走吧。`。传了多个参考音频却没写标记时,插件仍会在开头加标记,并在日志里提醒「多个参考音频建议在文本中用 @Audio1/@Audio2 指定各自朗读的段落」。
|
|
27
|
+
- **每次建议不超过 400 字**:模型上限 3000 字,但文本越长语速越快。超过 400 字(含加上的标记)时工具结果里会提醒一句,不会拒绝或截断。长旁白请分段生成,**每段都带同一组参考音频**,音色才不会变。加上标记后超过模型上限的,会在提交前直接拒绝。
|
|
28
|
+
- **工具说明重写**:`audio_generate` 的描述里写明:要固定音色就必须提供参考音频;插件会自动加 `@AudioN`;分段生成时每段都要传同一组参考音频;多角色对白怎么用标记。
|
|
29
|
+
|
|
13
30
|
## 0.11.4 用户可见更新
|
|
14
31
|
|
|
15
32
|
**较长的音色样本不再被误判失败,「我的音色」页面重新排版。**
|
|
@@ -495,6 +512,19 @@ npm run build
|
|
|
495
512
|
|
|
496
513
|
## English
|
|
497
514
|
|
|
515
|
+
### What changes in 0.11.6
|
|
516
|
+
|
|
517
|
+
**Generate a voice-over in one go**: the same model reading the same sentence twice came out 2 s apart (3.3 s against 5.3 s), so pace and pauses vary a lot from call to call, and a long narration stitched from separate calls changes rhythm part by part even when the voice stays the same. The `audio_generate` description now tells the agent to generate one batch of voice-over in one continuous call where it can, rather than many separate calls; when it must be split, to keep the same references, the same format and sample rate, and to submit the parts one after another in the same piece of work. The `@AudioN` markers of 0.11.5 were checked on the real gateway (no markers read aloud, nothing left out) and are unchanged.
|
|
518
|
+
|
|
519
|
+
### What changes in 0.11.5
|
|
520
|
+
|
|
521
|
+
**Speech reference audio now takes effect**: until now a reference audio was uploaded but the result came out in the default voice, and speech made in parts sounded like a different person in every part. Seed Audio 1.0 uses a reference only where the text names it with `@Audio1` / `@Audio2` / `@Audio3` (`references[0]` is `@Audio1`, in upload order, at most three), and the gateway adds no markers.
|
|
522
|
+
|
|
523
|
+
- **Markers are added for you**: when a speech request carries reference audio and its text names none, the plugin puts `@Audio1 @Audio2 …` (one per reference, at most three) in front of the text it sends. A text that already holds a marker is sent as written. Only the request body changes; the text you wrote and the conversation keep the original. Music and podcasts are not affected.
|
|
524
|
+
- **Dialogues with several characters**: pass one reference audio per character and mark in the text who reads which passage, for example `@Audio1 Lovely weather today. @Audio2 It is, let's go for a walk.`. Several references without markers still get markers in front, with a log warning that several reference audios should name the passage each one reads with @Audio1/@Audio2.
|
|
525
|
+
- **Up to about 400 characters per call**: the model takes up to 3000, but reads longer texts faster. Over 400 characters (markers included) the tool result says so; nothing is refused or cut. Split long narration into parts and **pass the same references with every part**, or the voice changes. A text that exceeds the model's limit only once the markers are added is refused before it is submitted.
|
|
526
|
+
- **Clearer tool description**: `audio_generate` now says that a fixed voice needs references, that the plugin adds `@AudioN`, that every part of speech made in parts needs the same references, and how to mark a dialogue.
|
|
527
|
+
|
|
498
528
|
### What changes in 0.11.4
|
|
499
529
|
|
|
500
530
|
**Longer voice samples are no longer reported as failed, and 「我的音色」 (My voices) has a new layout.**
|
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
THIRD-PARTY NOTICES · @vibedev-si/dsh-vibedev 0.11.
|
|
1
|
+
THIRD-PARTY NOTICES · @vibedev-si/dsh-vibedev 0.11.6
|
|
2
2
|
|
|
3
3
|
This package bundles code from the projects below. Each is used under the licence that
|
|
4
4
|
follows its name; the licence texts are reproduced as the projects ship them.
|
package/lib/audio/request.d.ts
CHANGED
|
@@ -142,12 +142,30 @@ export declare function supportsVoiceCover(model: MediaModel): boolean;
|
|
|
142
142
|
* `musicModel` itself names it.
|
|
143
143
|
*/
|
|
144
144
|
export declare function chooseAudioModel(runtime: MediaRuntime, request: Pick<AudioRequest, 'kind' | 'model'> & Partial<AudioRequest>, signal?: AbortSignal): Promise<MediaModel>;
|
|
145
|
+
/** The most reference audio a speech text can name (`@Audio1`–`@Audio3`). */
|
|
146
|
+
export declare const MAX_AUDIO_MARKERS = 3;
|
|
147
|
+
/** Speech texts longer than this are read faster by the model; split long narration instead. */
|
|
148
|
+
export declare const SPEECH_RECOMMENDED_CHARS = 400;
|
|
149
|
+
/**
|
|
150
|
+
* The speech text as sent: Seed takes its reference audio only where the text names it (`@Audio1` for
|
|
151
|
+
* `references[0]`, `@Audio2` for the next, at most three), and the gateway adds no markers. A text that already names
|
|
152
|
+
* one is sent as written; otherwise `@Audio1 @Audio2 …` (one per reference) goes in front.
|
|
153
|
+
* @param text - the text as the caller wrote it (never changed).
|
|
154
|
+
* @param references - how many reference audio files the request carries.
|
|
155
|
+
* @returns the text to send, and whether markers were added.
|
|
156
|
+
*/
|
|
157
|
+
export declare function withAudioMarkers(text: string, references: number): {
|
|
158
|
+
readonly text: string;
|
|
159
|
+
readonly injected: boolean;
|
|
160
|
+
};
|
|
145
161
|
/** A checked, priced audio task ready to submit. */
|
|
146
162
|
export interface PreparedAudio {
|
|
147
163
|
readonly model: MediaModel;
|
|
148
164
|
readonly kind: AudioMakeKind;
|
|
149
165
|
readonly quote: AudioQuote;
|
|
150
166
|
readonly draft: TaskRecord;
|
|
167
|
+
/** Advice for the caller that does not stop the request (a long speech text, say). */
|
|
168
|
+
readonly notes?: readonly string[];
|
|
151
169
|
}
|
|
152
170
|
/**
|
|
153
171
|
* Everything before an audio submission: choose the model, check every field
|
package/lib/index.js
CHANGED
|
@@ -12631,6 +12631,27 @@ async function chooseAudioModel(runtime, request, signal) {
|
|
|
12631
12631
|
if (audioKindOf(model) === void 0) throw localInputError(`${model.id} does not declare what kind of audio it makes, so it cannot be used for generation.`, "AUDIO_KIND_UNDECLARED", { field: "model" });
|
|
12632
12632
|
return model;
|
|
12633
12633
|
}
|
|
12634
|
+
/** A reference marker the text already carries. */
|
|
12635
|
+
const AUDIO_MARKER = /@Audio[1-9]/;
|
|
12636
|
+
/**
|
|
12637
|
+
* The speech text as sent: Seed takes its reference audio only where the text names it (`@Audio1` for
|
|
12638
|
+
* `references[0]`, `@Audio2` for the next, at most three), and the gateway adds no markers. A text that already names
|
|
12639
|
+
* one is sent as written; otherwise `@Audio1 @Audio2 …` (one per reference) goes in front.
|
|
12640
|
+
* @param text - the text as the caller wrote it (never changed).
|
|
12641
|
+
* @param references - how many reference audio files the request carries.
|
|
12642
|
+
* @returns the text to send, and whether markers were added.
|
|
12643
|
+
*/
|
|
12644
|
+
function withAudioMarkers(text, references) {
|
|
12645
|
+
const count = Math.min(references, 3);
|
|
12646
|
+
if (count <= 0 || AUDIO_MARKER.test(text)) return {
|
|
12647
|
+
text,
|
|
12648
|
+
injected: false
|
|
12649
|
+
};
|
|
12650
|
+
return {
|
|
12651
|
+
text: `${Array.from({ length: count }, (_, index) => `@Audio${index + 1}`).join(" ")} ${text}`,
|
|
12652
|
+
injected: true
|
|
12653
|
+
};
|
|
12654
|
+
}
|
|
12634
12655
|
/**
|
|
12635
12656
|
* Everything before an audio submission: choose the model, check every field
|
|
12636
12657
|
* against its declaration, upload and measure speech references, price it,
|
|
@@ -12650,6 +12671,20 @@ async function prepareAudioTask(runtime, call, request, save) {
|
|
|
12650
12671
|
const references = request.references ?? [];
|
|
12651
12672
|
if (references.length > 0) body.references = (await uploadReferences(runtime, call, model, references, body)).map((item) => model.audio?.references?.form === "object" ? { audio_url: item.asset.referenceUrl } : item.asset.referenceUrl);
|
|
12652
12673
|
else if ((model.audio?.references?.min ?? 0) > 0) refuse$1(`${model.id} needs at least ${model.audio?.references?.min} reference audio file(s).`, "references");
|
|
12674
|
+
const notes = [];
|
|
12675
|
+
const promptField = promptFieldOf(model);
|
|
12676
|
+
if (kind === "speech" && promptField !== void 0 && typeof body[promptField] === "string") {
|
|
12677
|
+
const marked = withAudioMarkers(body[promptField], references.length);
|
|
12678
|
+
if (marked.injected) {
|
|
12679
|
+
const markers = marked.text.slice(0, marked.text.length - body[promptField].length - 1);
|
|
12680
|
+
const max = model.audio?.maxPromptChars;
|
|
12681
|
+
if (max !== void 0 && [...marked.text].length > max) refuse$1(`With the reference markers added in front (${markers}), the text is ${[...marked.text].length} characters; ${model.id} takes at most ${max}. Shorten it or split it into parts, each with the same references.`, promptField);
|
|
12682
|
+
body[promptField] = marked.text;
|
|
12683
|
+
if (references.length >= 2) runtime.log(`dsh-vibedev: ${references.length} reference audio files for ${model.id} and no @AudioN marker in the text; added ${markers} in front. With several reference audios, name which one reads each passage in the text with @Audio1/@Audio2.`);
|
|
12684
|
+
}
|
|
12685
|
+
const length = [...body[promptField]].length;
|
|
12686
|
+
if (length > 400) notes.push(`The speech text is ${length} characters; up to 400 per request is recommended (the model reads longer texts faster). For long narration, split it into parts and pass the same references with every part so the voice stays the same.`);
|
|
12687
|
+
}
|
|
12653
12688
|
if (kind === "music" && has(request.sourceAudio)) body.source_audio_url = await uploadSourceAudio(runtime, call, request.sourceAudio.trim());
|
|
12654
12689
|
const quote = quoteAudio(model);
|
|
12655
12690
|
const mode = kind === "music" ? musicModeOf(request) : "generate";
|
|
@@ -12703,7 +12738,8 @@ async function prepareAudioTask(runtime, call, request, save) {
|
|
|
12703
12738
|
unit: quote.unit,
|
|
12704
12739
|
...quote.unitPriceCny === void 0 ? {} : { unitPriceCny: String(quote.unitPriceCny) }
|
|
12705
12740
|
} }
|
|
12706
|
-
}
|
|
12741
|
+
},
|
|
12742
|
+
...notes.length === 0 ? {} : { notes }
|
|
12707
12743
|
};
|
|
12708
12744
|
}
|
|
12709
12745
|
function excerptOf(text, max = 60) {
|
|
@@ -16382,7 +16418,7 @@ function mediaAccountTool(runtime, chain, login) {
|
|
|
16382
16418
|
function audioGenerateTool(runtime) {
|
|
16383
16419
|
return defineTool({
|
|
16384
16420
|
name: "audio_generate",
|
|
16385
|
-
description: "Generate music (a song with vocals or an instrumental), a podcast episode (a spoken conversation about a topic or a web page) or speech (text read aloud
|
|
16421
|
+
description: "Generate music (a song with vocals or an instrumental), a podcast episode (a spoken conversation about a topic or a web page) or speech (text read aloud; to keep a fixed voice you must pass references, the reference audio of that voice) with a VibeDev audio model. It runs as a background job: this call returns once the gateway accepts the task, you are notified when it finishes, and the files are saved in the workspace (media/audio/). Each model takes only the fields it declares; media_models lists them with prices (music and podcasts per request, speech per second of original audio). Final billing follows the gateway receipt. Music covers, on a model that declares the fields: voice_id (a vp_… voice profile from voice_profile_list, for 音色翻唱) and/or source_audio (a song to cover, 上传翻唱). The mode is chosen automatically and sent as mode when the model declares it: voice_id given → voice_cover; only source_audio → cover; neither → generate. voice_id together with source_audio means covering that audio in the chosen voice (voice_cover, both sent). Without a named model a voice cover uses the first model that supports voice covers (media_models), while covers and plain songs use the music model. audio_weight (0–1) applies only to a cover or voice cover. Speech voices: the references decide the voice, and the plugin puts @Audio1 @Audio2 … in front of the text so the model uses them. When the user wants a dialogue with several characters, pass one reference per voice and mark in the text which reference reads each passage with @Audio1/@Audio2/@Audio3 (references[0] is @Audio1); a text that already holds such a marker is sent as written. Voice-overs: generate one batch of voice-over in one continuous call where you can, rather than many separate calls: the same model reads the same text with quite different pace and pauses from one call to the next (two runs measured 2 s apart), so parts from separate calls do not keep the same rhythm. When it must be split (over about 400 characters, say), keep the same references, the same format and sample rate, and submit the parts one after another in the same piece of work; parts without the same references also change voice.",
|
|
16386
16422
|
parameters: {
|
|
16387
16423
|
type: {
|
|
16388
16424
|
type: "string",
|
|
@@ -16392,7 +16428,7 @@ function audioGenerateTool(runtime) {
|
|
|
16392
16428
|
},
|
|
16393
16429
|
prompt: {
|
|
16394
16430
|
type: "string",
|
|
16395
|
-
description: "Music: style, mood, instruments, tempo, theme (required). Podcast: the topic and angle; give a prompt, a source_url, or both. Speech: the exact text to speak (required)."
|
|
16431
|
+
description: "Music: style, mood, instruments, tempo, theme (required). Podcast: the topic and angle; give a prompt, a source_url, or both. Speech: the exact text to speak (required); up to about 400 characters per call is recommended (the model takes at most 3000, and reads longer texts faster). Prefer one call for a long narration; when it must be split, keep the same references and the same format and sample rate for every part. In a dialogue, @Audio1/@Audio2/@Audio3 in the text say which reference voice reads each passage."
|
|
16396
16432
|
},
|
|
16397
16433
|
lyrics: {
|
|
16398
16434
|
type: "string",
|
|
@@ -16441,7 +16477,7 @@ function audioGenerateTool(runtime) {
|
|
|
16441
16477
|
references: {
|
|
16442
16478
|
type: "array",
|
|
16443
16479
|
items: { type: "string" },
|
|
16444
|
-
description: `Speech only: reference audio
|
|
16480
|
+
description: `Speech only: the reference audio that decides the voice, each ${SOURCE_HELP}; references[0] is @Audio1, the next @Audio2, at most 3. The plugin puts @Audio1 @Audio2 … in front of the text unless it already names one. When speech is generated in parts, every part must pass the same references, or the voice changes. The model states how many, how large and how long.`
|
|
16445
16481
|
},
|
|
16446
16482
|
format: {
|
|
16447
16483
|
type: "string",
|
|
@@ -16548,11 +16584,12 @@ function audioGenerateTool(runtime) {
|
|
|
16548
16584
|
podcast: "Podcast",
|
|
16549
16585
|
speech: "Speech"
|
|
16550
16586
|
}[kind];
|
|
16587
|
+
const advice = (prepared.notes ?? []).map((note) => ` Note: ${note}`).join("");
|
|
16551
16588
|
if (jobId !== void 0) return {
|
|
16552
16589
|
...base,
|
|
16553
16590
|
status: accepted.status,
|
|
16554
16591
|
jobId,
|
|
16555
|
-
message: `${unconfirmed ? `${name} task ${accepted.id} (${model.id}): ${UNCONFIRMED_NOTE}` : `${name} task submitted to ${model.id}.`} Background job ${jobId} reports when it finishes; files are saved under ${runtime.display(exec, accepted.outputDir)}. ${accepted.estimatedCny === void 0 ? `Price: ${quote.basis.en}. ` : `Estimated ${yuan(Number(accepted.estimatedCny))}, charged only if it succeeds. `}Carry on with other work meanwhile; there is no need to poll.`
|
|
16592
|
+
message: `${unconfirmed ? `${name} task ${accepted.id} (${model.id}): ${UNCONFIRMED_NOTE}` : `${name} task submitted to ${model.id}.`} Background job ${jobId} reports when it finishes; files are saved under ${runtime.display(exec, accepted.outputDir)}. ${accepted.estimatedCny === void 0 ? `Price: ${quote.basis.en}. ` : `Estimated ${yuan(Number(accepted.estimatedCny))}, charged only if it succeeds. `}Carry on with other work meanwhile; there is no need to poll.` + advice
|
|
16556
16593
|
};
|
|
16557
16594
|
const final = await waitForTask(runtime, exec, accepted);
|
|
16558
16595
|
return {
|
|
@@ -16565,7 +16602,7 @@ function audioGenerateTool(runtime) {
|
|
|
16565
16602
|
...output.durationSeconds === void 0 ? {} : { durationSeconds: output.durationSeconds },
|
|
16566
16603
|
...output.originalSeconds === void 0 ? {} : { originalSeconds: output.originalSeconds }
|
|
16567
16604
|
})) },
|
|
16568
|
-
message: describeTask(runtime, exec, final)
|
|
16605
|
+
message: describeTask(runtime, exec, final) + advice
|
|
16569
16606
|
};
|
|
16570
16607
|
}
|
|
16571
16608
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibedev-si/dsh-vibedev",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "VibeDev 账号与模型:在 DeepSeek Harness 里登录 VibeDev,与 DeepSeek 账号并存,使用 VibeDev 网关的模型(Claude、GPT 等),并生成图片、视频、音乐和播客 · VibeDev account and models for DeepSeek Harness: sign in to VibeDev next to the DeepSeek account and use the VibeDev gateway's models (Claude, GPT and more), plus image, video, music and podcast generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|