@vibedev-si/dsh-vibedev 0.11.3 → 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 +46 -0
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/client/client.account-center.js +496 -184
- package/client/client.js +36 -2
- package/lib/audio/request.d.ts +18 -0
- package/lib/audio/voice-profiles.d.ts +23 -0
- package/lib/index.js +108 -9
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -2483,7 +2483,24 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
2483
2483
|
voiceErrorCode: "错误码 {code}",
|
|
2484
2484
|
voiceRejectSimilar: "这段样本和已有录音太像,请换一段干净、独特的人声。",
|
|
2485
2485
|
voiceRejectNotClean: "这不是干净的人声:请换一段只有一个人声、不带伴奏和杂音的录音。",
|
|
2486
|
-
voiceRejectOriginal: "原始原因:{reason}"
|
|
2486
|
+
voiceRejectOriginal: "原始原因:{reason}",
|
|
2487
|
+
voiceDropTitle: "点击或拖入音频文件",
|
|
2488
|
+
voiceFileAdvice: "建议 10–60 秒、只有一个人声的干净录音,不带伴奏和杂音。",
|
|
2489
|
+
voiceDropActive: "松开即可添加",
|
|
2490
|
+
voiceDropFormats: "mp3 · wav · m4a · aac · flac · ogg,6–60 秒,不超过 10 MB",
|
|
2491
|
+
voiceChangeFile: "重新选择",
|
|
2492
|
+
voiceMeasuring: "正在测量时长…",
|
|
2493
|
+
voicePickFile: "选择音频文件",
|
|
2494
|
+
voiceNameHint: "最多 {max} 个字,只用来在列表里区分音色。",
|
|
2495
|
+
voiceNeedFile: "请先选择一个音频文件",
|
|
2496
|
+
voiceNeedName: "请填写音色名称",
|
|
2497
|
+
voiceListCount: "共 {count} 个",
|
|
2498
|
+
voiceLoadFailed: "音色列表没有读到",
|
|
2499
|
+
voiceUnsupportedTitle: "暂未开放音色管理",
|
|
2500
|
+
voiceRetry: "重试",
|
|
2501
|
+
voiceWaitingGateway: "网关处理中,已等待 {seconds} 秒。较长的样本可能需要 1–3 分钟,请不要关闭页面。",
|
|
2502
|
+
voiceConfirming: "网关没有及时回复,音色可能已经创建,正在确认(已等待 {seconds} 秒)…",
|
|
2503
|
+
voiceUnconfirmed: "网关处理超时。可能已在网关侧创建,请稍后刷新列表确认;若列表没有,再重试。"
|
|
2487
2504
|
};
|
|
2488
2505
|
const voiceProfileEn = {
|
|
2489
2506
|
centerVoiceProfiles: "My voices",
|
|
@@ -2549,7 +2566,24 @@ window.__ModuleLoader__.load({ id: "@vibedev-si/dsh-vibedev", factory: (require)
|
|
|
2549
2566
|
voiceErrorCode: "Error code {code}",
|
|
2550
2567
|
voiceRejectSimilar: "This sample is too similar to an existing recording. Use a different clean, original vocal.",
|
|
2551
2568
|
voiceRejectNotClean: "This is not a clean solo vocal. Use a recording of one voice without accompaniment or background noise.",
|
|
2552
|
-
voiceRejectOriginal: "Original reason: {reason}"
|
|
2569
|
+
voiceRejectOriginal: "Original reason: {reason}",
|
|
2570
|
+
voiceDropTitle: "Click or drop an audio file here",
|
|
2571
|
+
voiceFileAdvice: "A clean recording of one voice, 10–60 s, without accompaniment or background noise, works best.",
|
|
2572
|
+
voiceDropActive: "Release to add it",
|
|
2573
|
+
voiceDropFormats: "mp3 · wav · m4a · aac · flac · ogg, 6–60 s, up to 10 MB",
|
|
2574
|
+
voiceChangeFile: "Choose another",
|
|
2575
|
+
voiceMeasuring: "Measuring length…",
|
|
2576
|
+
voicePickFile: "Choose an audio file",
|
|
2577
|
+
voiceNameHint: "Up to {max} characters, only to tell your voices apart.",
|
|
2578
|
+
voiceNeedFile: "Choose an audio file first",
|
|
2579
|
+
voiceNeedName: "Enter a name for the voice",
|
|
2580
|
+
voiceListCount: "{count} in total",
|
|
2581
|
+
voiceLoadFailed: "The voice list could not be read",
|
|
2582
|
+
voiceUnsupportedTitle: "Voice profiles are not available yet",
|
|
2583
|
+
voiceRetry: "Try again",
|
|
2584
|
+
voiceWaitingGateway: "The gateway is processing, {seconds} s so far. A longer sample can take 1–3 minutes; keep this page open.",
|
|
2585
|
+
voiceConfirming: "The gateway did not answer in time. The voice may already exist; checking ({seconds} s so far)…",
|
|
2586
|
+
voiceUnconfirmed: "The gateway timed out. The voice may have been created there: refresh the list in a little while to check, and try again only if it is not there."
|
|
2553
2587
|
};
|
|
2554
2588
|
//#endregion
|
|
2555
2589
|
//#region src/client/AccountCenter/center-locales.ts
|
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
|
|
@@ -42,6 +42,20 @@ export declare const VOICE_SAMPLE_LIMITS: {
|
|
|
42
42
|
};
|
|
43
43
|
/** Longest profile title. */
|
|
44
44
|
export declare const VOICE_TITLE_MAX = 80;
|
|
45
|
+
/** How long the creation request may take: Suno can need well over a minute for a longer sample. */
|
|
46
|
+
export declare const VOICE_CREATE_TIMEOUT_MS = 180000;
|
|
47
|
+
/** How long the list is read for a profile whose creation ended without an answer. */
|
|
48
|
+
export declare const VOICE_CONFIRM_TIMEOUT_MS = 180000;
|
|
49
|
+
/**
|
|
50
|
+
* The creation's `Idempotency-Key`: the same sample under the same title always sends the same key, so a retry is the
|
|
51
|
+
* same operation to a gateway that deduplicates by it; a different title is a different profile.
|
|
52
|
+
* @param data - the sample's bytes.
|
|
53
|
+
* @param title - the checked title.
|
|
54
|
+
* @returns `vp-` and 32 hex digits.
|
|
55
|
+
*/
|
|
56
|
+
export declare function voiceIdempotencyKey(data: Uint8Array, title: string): string;
|
|
57
|
+
/** A creation whose outcome the client cannot know: no answer in time, no connection, or the gateway's 504. */
|
|
58
|
+
export declare function voiceOutcomeUnknown(error: unknown): boolean;
|
|
45
59
|
/** A profile's state: being made, usable, refused, or closed. */
|
|
46
60
|
export type VoiceProfileStatus = 'processing' | 'ready' | 'failed' | 'deleted';
|
|
47
61
|
/** Why a provider refused a voice sample, in words a person understands. */
|
|
@@ -137,6 +151,8 @@ export interface VoiceProfilesOptions {
|
|
|
137
151
|
/** Waits between status reads; a test seam. */
|
|
138
152
|
readonly sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
139
153
|
readonly now?: () => number;
|
|
154
|
+
/** How long a creation without an answer is confirmed from the list; {@link VOICE_CONFIRM_TIMEOUT_MS} by default. */
|
|
155
|
+
readonly confirmTimeoutMs?: number;
|
|
140
156
|
}
|
|
141
157
|
/** Per-request options: cancellation, and the account guard of the account center. */
|
|
142
158
|
export interface VoiceRequestOptions {
|
|
@@ -169,6 +185,13 @@ export declare class VoiceProfiles {
|
|
|
169
185
|
* @returns the profile as the gateway answered (often still being made).
|
|
170
186
|
*/
|
|
171
187
|
create(media: LoadedMedia, title: string, options?: VoiceRequestOptions): Promise<VoiceProfile>;
|
|
188
|
+
/**
|
|
189
|
+
* Find the profile a creation without an answer made: read the list (after 3 s, 5 s, then every 10 s, for up to
|
|
190
|
+
* three minutes) for an id that was not there before, the one under the same title first. Without the earlier list,
|
|
191
|
+
* only a profile under the same title counts.
|
|
192
|
+
* @throws {@link MediaError} `VOICE_PROFILE_UNCONFIRMED` (retryable, outcome unknown, nothing charged) when none appears.
|
|
193
|
+
*/
|
|
194
|
+
private confirmCreated;
|
|
172
195
|
/**
|
|
173
196
|
* Close one profile for good. Songs already made with it are not affected.
|
|
174
197
|
* @param id - a `vp_…` id.
|
package/lib/index.js
CHANGED
|
@@ -11824,6 +11824,23 @@ const VOICE_SAMPLE_LIMITS = {
|
|
|
11824
11824
|
"audio/ogg"
|
|
11825
11825
|
]
|
|
11826
11826
|
};
|
|
11827
|
+
/** How long the creation request may take: Suno can need well over a minute for a longer sample. */
|
|
11828
|
+
const VOICE_CREATE_TIMEOUT_MS = 18e4;
|
|
11829
|
+
/**
|
|
11830
|
+
* The creation's `Idempotency-Key`: the same sample under the same title always sends the same key, so a retry is the
|
|
11831
|
+
* same operation to a gateway that deduplicates by it; a different title is a different profile.
|
|
11832
|
+
* @param data - the sample's bytes.
|
|
11833
|
+
* @param title - the checked title.
|
|
11834
|
+
* @returns `vp-` and 32 hex digits.
|
|
11835
|
+
*/
|
|
11836
|
+
function voiceIdempotencyKey(data, title) {
|
|
11837
|
+
const sample = createHash("sha256").update(data).digest("hex");
|
|
11838
|
+
return `vp-${createHash("sha256").update(`${sample}\n${title}`).digest("hex").slice(0, 32)}`;
|
|
11839
|
+
}
|
|
11840
|
+
/** A creation whose outcome the client cannot know: no answer in time, no connection, or the gateway's 504. */
|
|
11841
|
+
function voiceOutcomeUnknown(error) {
|
|
11842
|
+
return error instanceof MediaError && (error.code === "GATEWAY_TIMEOUT" || error.code === "GATEWAY_UNREACHABLE" || error.details.status === 504);
|
|
11843
|
+
}
|
|
11827
11844
|
/**
|
|
11828
11845
|
* Provider refusals and what they mean, checked in order against the reason and the code (Suno refuses a sample that
|
|
11829
11846
|
* "matches an existing recording", for one). A reason none of them matches is shown as it came, scrubbed.
|
|
@@ -12126,12 +12143,16 @@ var VoiceProfiles = class {
|
|
|
12126
12143
|
submissionState: "not_submitted",
|
|
12127
12144
|
billingState: "not_charged"
|
|
12128
12145
|
});
|
|
12146
|
+
const before = await this.list(options).then((list) => new Set(list.map((item) => item.id)), (error) => {
|
|
12147
|
+
if (error instanceof MediaError && (error.code === "ABORTED" || error.code === "ACCOUNT_CHANGED")) throw error;
|
|
12148
|
+
});
|
|
12129
12149
|
let answer;
|
|
12130
12150
|
try {
|
|
12131
12151
|
answer = await this.options.http.json(VOICE_PROFILES_PATH, {
|
|
12132
12152
|
...this.request(options),
|
|
12153
|
+
timeoutMs: VOICE_CREATE_TIMEOUT_MS,
|
|
12133
12154
|
method: "POST",
|
|
12134
|
-
idempotencyKey:
|
|
12155
|
+
idempotencyKey: voiceIdempotencyKey(media.data, name),
|
|
12135
12156
|
busyRetries: 0,
|
|
12136
12157
|
json: {
|
|
12137
12158
|
model: VOICE_PROFILE_MODEL,
|
|
@@ -12140,6 +12161,13 @@ var VoiceProfiles = class {
|
|
|
12140
12161
|
}
|
|
12141
12162
|
});
|
|
12142
12163
|
} catch (error) {
|
|
12164
|
+
if (voiceOutcomeUnknown(error)) {
|
|
12165
|
+
const confirmed = await this.confirmCreated(before, name, options);
|
|
12166
|
+
return {
|
|
12167
|
+
...confirmed,
|
|
12168
|
+
...confirmed.durationSeconds === void 0 ? { durationSeconds: Math.round(measured * 10) / 10 } : {}
|
|
12169
|
+
};
|
|
12170
|
+
}
|
|
12143
12171
|
const rejection = error instanceof MediaError && (error.details.status ?? 0) >= 400 && (error.details.status ?? 0) < 500 ? voiceRejectionOf(error.message, error.code) : void 0;
|
|
12144
12172
|
if (rejection === void 0) throw error;
|
|
12145
12173
|
throw new MediaError(`${rejection.en} ${rejection.zh} (${scrubReason(error.message)}) No voice profile was created and nothing was charged.`, "VOICE_SAMPLE_REJECTED", {
|
|
@@ -12163,6 +12191,40 @@ var VoiceProfiles = class {
|
|
|
12163
12191
|
};
|
|
12164
12192
|
}
|
|
12165
12193
|
/**
|
|
12194
|
+
* Find the profile a creation without an answer made: read the list (after 3 s, 5 s, then every 10 s, for up to
|
|
12195
|
+
* three minutes) for an id that was not there before, the one under the same title first. Without the earlier list,
|
|
12196
|
+
* only a profile under the same title counts.
|
|
12197
|
+
* @throws {@link MediaError} `VOICE_PROFILE_UNCONFIRMED` (retryable, outcome unknown, nothing charged) when none appears.
|
|
12198
|
+
*/
|
|
12199
|
+
async confirmCreated(before, title, options) {
|
|
12200
|
+
const started = this.now();
|
|
12201
|
+
const limit = this.options.confirmTimeoutMs ?? 18e4;
|
|
12202
|
+
const steps = [3e3, 5e3];
|
|
12203
|
+
for (let round = 0;; round++) {
|
|
12204
|
+
const left = started + limit - this.now();
|
|
12205
|
+
if (left <= 0) break;
|
|
12206
|
+
await this.sleep(Math.min(steps[round] ?? 1e4, left), options.signal);
|
|
12207
|
+
let list;
|
|
12208
|
+
try {
|
|
12209
|
+
list = await this.list(options);
|
|
12210
|
+
} catch (error) {
|
|
12211
|
+
if (error instanceof MediaError && (error.code === "ABORTED" || error.code === "ACCOUNT_CHANGED")) throw error;
|
|
12212
|
+
continue;
|
|
12213
|
+
}
|
|
12214
|
+
const fresh = list.filter((item) => before === void 0 ? item.title === title : !before.has(item.id));
|
|
12215
|
+
const found = fresh.find((item) => item.title === title) ?? fresh[0];
|
|
12216
|
+
if (found !== void 0) return found;
|
|
12217
|
+
}
|
|
12218
|
+
throw new MediaError("The VibeDev gateway did not answer in time while creating the voice profile. It may have been created on the gateway: refresh the list in a little while to check, and try again only if it is not there. 网关处理超时。可能已在网关侧创建,请稍后刷新列表确认;若列表没有,再重试。", "VOICE_PROFILE_UNCONFIRMED", {
|
|
12219
|
+
category: "submission_uncertain",
|
|
12220
|
+
stage: "submit",
|
|
12221
|
+
retryable: true,
|
|
12222
|
+
submissionState: "unknown",
|
|
12223
|
+
billingState: "not_charged",
|
|
12224
|
+
retryAction: "reconcile"
|
|
12225
|
+
});
|
|
12226
|
+
}
|
|
12227
|
+
/**
|
|
12166
12228
|
* Close one profile for good. Songs already made with it are not affected.
|
|
12167
12229
|
* @param id - a `vp_…` id.
|
|
12168
12230
|
*/
|
|
@@ -12569,6 +12631,27 @@ async function chooseAudioModel(runtime, request, signal) {
|
|
|
12569
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" });
|
|
12570
12632
|
return model;
|
|
12571
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
|
+
}
|
|
12572
12655
|
/**
|
|
12573
12656
|
* Everything before an audio submission: choose the model, check every field
|
|
12574
12657
|
* against its declaration, upload and measure speech references, price it,
|
|
@@ -12588,6 +12671,20 @@ async function prepareAudioTask(runtime, call, request, save) {
|
|
|
12588
12671
|
const references = request.references ?? [];
|
|
12589
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);
|
|
12590
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
|
+
}
|
|
12591
12688
|
if (kind === "music" && has(request.sourceAudio)) body.source_audio_url = await uploadSourceAudio(runtime, call, request.sourceAudio.trim());
|
|
12592
12689
|
const quote = quoteAudio(model);
|
|
12593
12690
|
const mode = kind === "music" ? musicModeOf(request) : "generate";
|
|
@@ -12641,7 +12738,8 @@ async function prepareAudioTask(runtime, call, request, save) {
|
|
|
12641
12738
|
unit: quote.unit,
|
|
12642
12739
|
...quote.unitPriceCny === void 0 ? {} : { unitPriceCny: String(quote.unitPriceCny) }
|
|
12643
12740
|
} }
|
|
12644
|
-
}
|
|
12741
|
+
},
|
|
12742
|
+
...notes.length === 0 ? {} : { notes }
|
|
12645
12743
|
};
|
|
12646
12744
|
}
|
|
12647
12745
|
function excerptOf(text, max = 60) {
|
|
@@ -16320,7 +16418,7 @@ function mediaAccountTool(runtime, chain, login) {
|
|
|
16320
16418
|
function audioGenerateTool(runtime) {
|
|
16321
16419
|
return defineTool({
|
|
16322
16420
|
name: "audio_generate",
|
|
16323
|
-
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.",
|
|
16324
16422
|
parameters: {
|
|
16325
16423
|
type: {
|
|
16326
16424
|
type: "string",
|
|
@@ -16330,7 +16428,7 @@ function audioGenerateTool(runtime) {
|
|
|
16330
16428
|
},
|
|
16331
16429
|
prompt: {
|
|
16332
16430
|
type: "string",
|
|
16333
|
-
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."
|
|
16334
16432
|
},
|
|
16335
16433
|
lyrics: {
|
|
16336
16434
|
type: "string",
|
|
@@ -16379,7 +16477,7 @@ function audioGenerateTool(runtime) {
|
|
|
16379
16477
|
references: {
|
|
16380
16478
|
type: "array",
|
|
16381
16479
|
items: { type: "string" },
|
|
16382
|
-
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.`
|
|
16383
16481
|
},
|
|
16384
16482
|
format: {
|
|
16385
16483
|
type: "string",
|
|
@@ -16486,11 +16584,12 @@ function audioGenerateTool(runtime) {
|
|
|
16486
16584
|
podcast: "Podcast",
|
|
16487
16585
|
speech: "Speech"
|
|
16488
16586
|
}[kind];
|
|
16587
|
+
const advice = (prepared.notes ?? []).map((note) => ` Note: ${note}`).join("");
|
|
16489
16588
|
if (jobId !== void 0) return {
|
|
16490
16589
|
...base,
|
|
16491
16590
|
status: accepted.status,
|
|
16492
16591
|
jobId,
|
|
16493
|
-
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
|
|
16494
16593
|
};
|
|
16495
16594
|
const final = await waitForTask(runtime, exec, accepted);
|
|
16496
16595
|
return {
|
|
@@ -16503,7 +16602,7 @@ function audioGenerateTool(runtime) {
|
|
|
16503
16602
|
...output.durationSeconds === void 0 ? {} : { durationSeconds: output.durationSeconds },
|
|
16504
16603
|
...output.originalSeconds === void 0 ? {} : { originalSeconds: output.originalSeconds }
|
|
16505
16604
|
})) },
|
|
16506
|
-
message: describeTask(runtime, exec, final)
|
|
16605
|
+
message: describeTask(runtime, exec, final) + advice
|
|
16507
16606
|
};
|
|
16508
16607
|
}
|
|
16509
16608
|
});
|
|
@@ -17175,7 +17274,7 @@ const LIMITS = `${VOICE_SAMPLE_LIMITS.minSeconds}–${VOICE_SAMPLE_LIMITS.maxSec
|
|
|
17175
17274
|
function voiceProfileCreateTool(runtime, profiles) {
|
|
17176
17275
|
return defineTool({
|
|
17177
17276
|
name: "voice_profile_create",
|
|
17178
|
-
description: "Create a VibeDev voice profile (音色) from a recording of the user's own singing voice, for Suno voice covers (audio_generate voice_id). Free: it makes no song and charges nothing. The sample must be " + LIMITS + "; it is checked, uploaded to the VibeDev media library and submitted, and the call waits until the profile is ready or failed. The result is a vp_… id — the only form of voice id that exists for the user; never ask for or pass any other voice id. Only create one when the user asks, from audio they have the right to use. Do not promise that a profile is kept forever.",
|
|
17277
|
+
description: "Create a VibeDev voice profile (音色) from a recording of the user's own singing voice, for Suno voice covers (audio_generate voice_id). Free: it makes no song and charges nothing. The sample must be " + LIMITS + "; it is checked, uploaded to the VibeDev media library and submitted, and the call waits until the profile is ready or failed (creation can take 2–3 minutes; when the gateway does not answer in time the list is checked for the new profile before anything is reported). The result is a vp_… id — the only form of voice id that exists for the user; never ask for or pass any other voice id. Only create one when the user asks, from audio they have the right to use. Do not promise that a profile is kept forever.",
|
|
17179
17278
|
parameters: {
|
|
17180
17279
|
source: {
|
|
17181
17280
|
type: "string",
|
|
@@ -17205,7 +17304,7 @@ function voiceProfileCreateTool(runtime, profiles) {
|
|
|
17205
17304
|
text: value.message
|
|
17206
17305
|
}]
|
|
17207
17306
|
},
|
|
17208
|
-
timeoutMs:
|
|
17307
|
+
timeoutMs: 6e5,
|
|
17209
17308
|
async execute(args, exec) {
|
|
17210
17309
|
const title = checkVoiceTitle(args.title);
|
|
17211
17310
|
const media = await runtime.load(exec, args.source, "audio", VOICE_SAMPLE_LIMITS.maxBytes);
|
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",
|