dsh-audiogen 0.3.3 → 0.3.5
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/lib/client.js +378 -253
- package/lib/client.js.map +1 -1
- package/lib/index.js +141 -25
- package/package.json +1 -1
- package/skills/design/SKILL.md +7 -1
- package/skills/music/SKILL.md +13 -0
- package/skills/sfx/SKILL.md +17 -3
- package/src/agent-audio-tools.ts +7 -3
- package/src/audio-engine.ts +111 -7
- package/src/audio-presets.ts +6 -1
- package/src/client/AudioGenPanel.tsx +69 -5
- package/src/client/locales.ts +2 -2
- package/src/protocol.ts +5 -1
- package/src/routes.ts +10 -4
package/src/client/locales.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const zh = {
|
|
|
12
12
|
'mode.voiceDesign': '音色设计',
|
|
13
13
|
'prompt.placeholder': '输入文本、音乐/音效描述,或音色设计描述…',
|
|
14
14
|
'prompt.required': '请输入文本或提示词',
|
|
15
|
-
'model.label': '模型
|
|
15
|
+
'model.label': '模型',
|
|
16
16
|
'voice.label': '音色',
|
|
17
17
|
'speed.label': '语速',
|
|
18
18
|
'duration.label': '时长(秒)',
|
|
@@ -113,7 +113,7 @@ export const en: Record<AudioGenKey, string> = {
|
|
|
113
113
|
'mode.voiceDesign': 'Voice design',
|
|
114
114
|
'prompt.placeholder': 'Text to speak, or a music/SFX/voice-design description…',
|
|
115
115
|
'prompt.required': 'Prompt or text is required',
|
|
116
|
-
'model.label': 'Model
|
|
116
|
+
'model.label': 'Model',
|
|
117
117
|
'voice.label': 'Voice',
|
|
118
118
|
'speed.label': 'Speed',
|
|
119
119
|
'duration.label': 'Duration (s)',
|
package/src/protocol.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export const AUDIOGEN_SETTINGS_NAMESPACE = 'dsh-audiogen'
|
|
9
9
|
|
|
10
10
|
/** Published package version shared by the host updater and the client UI. */
|
|
11
|
-
export const PLUGIN_VERSION = '0.3.
|
|
11
|
+
export const PLUGIN_VERSION = '0.3.5'
|
|
12
12
|
|
|
13
13
|
/** Same-origin route family (loopback-only, mirroring dsh-imagegen). */
|
|
14
14
|
export const SETTINGS_API = {
|
|
@@ -118,6 +118,10 @@ export interface GenerateAudioRequest {
|
|
|
118
118
|
lyrics?: string
|
|
119
119
|
/** MiniMax 是否生成纯音乐(无歌词/人声);true 时 lyrics 可为空。 */
|
|
120
120
|
isInstrumental?: boolean
|
|
121
|
+
/** ElevenLabs 音效:生成无缝循环音效(loop,仅 eleven_text_to_sound_v2)。 */
|
|
122
|
+
loop?: boolean
|
|
123
|
+
/** ElevenLabs 音效:提示词影响度 0-1(prompt_influence,默认 0.3)。 */
|
|
124
|
+
promptInfluence?: number
|
|
121
125
|
/** Output format, e.g. mp3, wav, pcm. */
|
|
122
126
|
format?: string
|
|
123
127
|
/** Channel this request targets (host falls back to default). */
|
package/src/routes.ts
CHANGED
|
@@ -124,6 +124,8 @@ function parseGenerateRequest(body: Record<string, unknown>): GenerateAudioReque
|
|
|
124
124
|
...(num(body.duration) !== undefined ? { duration: num(body.duration)! } : {}),
|
|
125
125
|
...(typeof body.lyrics === 'string' && body.lyrics.trim() !== '' ? { lyrics: body.lyrics.trim() } : {}),
|
|
126
126
|
...(typeof body.isInstrumental === 'boolean' ? { isInstrumental: body.isInstrumental } : {}),
|
|
127
|
+
...(typeof body.loop === 'boolean' ? { loop: body.loop } : {}),
|
|
128
|
+
...(num(body.promptInfluence) !== undefined ? { promptInfluence: num(body.promptInfluence)! } : {}),
|
|
127
129
|
...(typeof body.format === 'string' && body.format.trim() !== '' ? { format: body.format.trim() } : {}),
|
|
128
130
|
...(typeof body.channelId === 'string' && body.channelId !== '' ? { channelId: body.channelId } : {}),
|
|
129
131
|
// ---- MiniMax TTS 专属字段(其他厂商忽略) ----
|
|
@@ -180,11 +182,15 @@ function resolveChannelRequest(
|
|
|
180
182
|
const defaults = view.channels.find(candidate => candidate.id === view.defaultChannelId) ?? view.channels[0]
|
|
181
183
|
const target = explicit ?? defaults
|
|
182
184
|
const asked = request.model.trim()
|
|
185
|
+
|
|
186
|
+
// 音色设计不按模型解析渠道:总是走 channelId(面板选择器)或默认渠道,
|
|
187
|
+
// 并丢弃可能残留的模型值,避免上一个模式的模型把渠道带偏。
|
|
188
|
+
if (request.mode === 'voice_design') {
|
|
189
|
+
if (target === undefined) return { ok: false, code: 'no-channels', message: '尚未配置任何渠道' }
|
|
190
|
+
return { ok: true, request: { ...request, model: '', upstream: undefined, channelId: target.id, channel: target.name } }
|
|
191
|
+
}
|
|
192
|
+
|
|
183
193
|
if (asked === '') {
|
|
184
|
-
if (request.mode === 'voice_design') {
|
|
185
|
-
if (target === undefined) return { ok: false, code: 'no-channels', message: '尚未配置任何渠道' }
|
|
186
|
-
return { ok: true, request: { ...request, channelId: target.id, channel: target.name } }
|
|
187
|
-
}
|
|
188
194
|
const alias = target?.models[0]?.alias ?? ''
|
|
189
195
|
if (alias === '') {
|
|
190
196
|
return { ok: false, code: 'no-models', message: `渠道「${target?.name ?? ''}」尚未配置模型/音色,请先在设置中添加` }
|