diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..88bff7d --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,52 @@ +# Copilot Instructions + +## Project shape + +- The whole application lives in `index.html`. Template markup, CSS overrides, Vue state, persistence, import/export, audio processing, and video generation are all defined there. +- This is a browser-first tool for AI audiobook production. The README positions it around LLM-driven script analysis plus IndexTTS / Qwen3TTS workflows, with users supplying OpenAI-compatible LLM endpoints and TTS service URLs. +- Frontend dependencies are loaded in the page, not through a package manager: Vue 3 and Tailwind via CDN, `mp4-muxer` via CDN, and ffmpeg helpers from `vendor\ffmpeg` plus ffmpeg core wasm loaded at runtime. + +## Commands and validation + +- There is no repository build, test, or lint manifest (`package.json`, `requirements.txt`, etc. are absent). +- There is no built-in single-test command because the repository does not ship a test suite. +- Typical local run path is to open `index.html` in a browser or serve the repository as static files. +- For quick syntax validation after editing the inline Vue app, extract the main ` -
+
+ +
+ +
+ + + + {{ t.message }} +
+
+
+ + +
+
+

{{ confirmDialog.message }}

+
+ + +
+
+
- 背景图片大图预览
-
-
-

Unitale AI 1.5

-

多角色音效合成有声书生成工具

-
-
v1.5
-
- - -
-
- - - - - -
+
+
+
+
+

Unitale AI

+
v1.5
+ + 多角色有声书工作台 + +
+

+ 把配置、素材库、脚本拆分、逐行精修和导出流程放进同一个浏览器工作台。 +

+
+
+ +
+
+ +
+
+
+
工作区导航
+
+ + + + + +
+
+ +
+
+
工程
+
+ + + +
+
+ +
+
音频与字幕
+
+ + +
+
- -
- - - - - - - +
+
视频导出
+
+ + +
+
+
+
-
+
-

LLM 模型配置(OpenAI通用接口)

+

LLM 模型配置(OpenAI通用接口)

-
+

{{ isEditing ? '编辑配置' : '添加新配置' }}

-
+
{{ isEditing ? '编辑配置' placeholder='例如: {"temperature": 0.7, "max_tokens": 2000}'>
-
+
+ class="px-6 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存配置 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
+ class="flex items-center justify-between p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md hover:border-blue-200 transition-all">
{{ conf.name }}
-
{{ conf.model }} | {{ conf.baseUrl }}
+
{{ conf.model }} | {{ conf.baseUrl }}
+ class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-sec">编辑 + class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-danger">删除
-
+
暂无配置,请在上方添加
-

TTS 语音合成配置

+

TTS 语音合成配置

-
+

{{ isEditingTts ? '编辑 TTS 配置' : '添加新 TTS 配置' }}

-
+
{{ isEditingTts ? '编辑 TTS placeholder="http://127.0.0.1:8300">
-
+
+ class="px-6 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存配置 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
+ class="flex items-center justify-between p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md hover:border-blue-200 transition-all">
{{ conf.name }}
-
{{ conf.baseUrl }}
+
{{ conf.baseUrl }}
+ class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-sec">编辑 + class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-danger">删除
-
+
暂无 TTS 配置,请在上方添加
@@ -268,11 +1209,11 @@

{{ isEditingTts ? '编辑 TTS
-

音色管理

+

音色管理

-
+

{{ isEditingTimbre ? '编辑音色' : '添加新音色' }}

-
+
{{ isEditingTimbre ? '编辑 + class="whitespace-nowrap px-3 py-2 border rounded-lg text-xs transition-colors btn-sec">选择文件 @@ -302,16 +1243,16 @@

{{ isEditingTimbre ? '编辑

+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存音色 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
+ class="flex items-center justify-between p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md hover:border-blue-200 transition-all">
@@ -319,14 +1260,14 @@

{{ isEditingTimbre ? '编辑

{{ timbre.name }}
-
{{ +
{{ timbre.description }}
-
{{ timbre.refPath }}
+
{{ timbre.refPath }}
- + class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-sec">编辑 + class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-danger">删除
-
+
暂无音色,请在上方添加
@@ -354,60 +1295,69 @@

{{ isEditingTimbre ? '编辑
-

情绪描述预设

+

情绪描述预设

-
-

{{ isEditingEmotion ? '编辑情绪预设' : '添加新情绪预设' }}

-
+
+
+

{{ isEditingEmotion ? '编辑情绪预设' : '添加新情绪预设' }}

+ +
+
-
- -
+
+ +
- {{ + {{ ['高兴','生气','伤心','害怕','厌恶','低落','惊喜','平静'][idx] }}
-
+
+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存情绪 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
+ class="p-3 bg-white border border-slate-200 rounded-xl hover:shadow-md hover:border-blue-200 transition-all flex justify-between items-center">
-
+
{{ emo.name }}
-
[{{ emo.vector.join(',') }}]
+
+
+
+
- + + class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-danger">删除
@@ -417,11 +1367,11 @@

{{ isEditingEmotion ? '编辑
-

音效素材管理

+

音效素材管理

音效和背景音乐可以自行使用其他的AI模型生成,或者前往在线免费音效网站下载:Pixabay在线音效库

-
+

{{ isEditingSfx ? '编辑音效' : '添加新音效' }}

-
+
{{ isEditingSfx ? '编辑音 + class="whitespace-nowrap px-3 py-2 border rounded-lg text-xs transition-colors btn-sec">选择文件 @@ -453,7 +1403,7 @@

{{ isEditingSfx ? '编辑音 默认音量 {{ Math.round((sfxForm.volume ?? 1) * 100) }}% -

+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存音效 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
-
+
@@ -506,7 +1456,7 @@

{{ isEditingSfx ? '编辑音

- - - + +
-
暂无音效素材
+
暂无音效素材
-

背景音乐管理 (BGM)

-
+

背景音乐管理 (BGM)

+

{{ isEditingBgm ? '编辑 BGM' : '添加新 BGM' }}

-
+
{{ isEditingBgm ? '编辑 BGM' + class="whitespace-nowrap px-3 py-2 border rounded-lg text-xs transition-colors btn-sec">选择文件 @@ -559,7 +1509,7 @@

{{ isEditingBgm ? '编辑 BGM' 默认音量 {{ Math.round((bgmForm.volume ?? 1) * 100) }}% -

+ class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
-
+
{{ bgm.name }}
-
{{ bgm.description }}
-
{{ bgm.filename }}
+
{{ bgm.description }}
+
{{ bgm.filename }}
- - - + +
-
暂无 BGM 素材
+
暂无 BGM 素材
-

音频滤波器管理

-
+

音频滤波器管理

+

{{ isEditingFilter ? '编辑滤波器' : '添加新滤波器' }}

-
+
{{ isEditingFilter ? '编辑
+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存滤波器 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">取消
+ class="p-4 bg-white border border-slate-200 rounded-xl hover:shadow-md hover:border-blue-200 transition-all flex justify-between items-center">
{{ isEditingFilter ? '编辑
+ class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-sec">编辑 + class="px-3 py-1.5 text-xs font-bold rounded-xl transition-all btn-danger">删除
暂无滤波器,请添加
+ class="col-span-full empty-state">暂无滤波器,请添加
@@ -716,36 +1666,83 @@

{{ isEditingFilter ? '编辑
-
-
- {{ script.name }} - - +
+
+
+
多脚本工作区
+
+
+
+
+
+ 双击修改名称 +
+
+
+
+ {{ script.name }} + + +
+ +
+
+
+ + 当前:{{ getCurrentScriptName() }} + + + 脚本块:{{ scriptLines.length }} + + + 角色:{{ characters.length }} + +
-
-
+
-
-
-

+
+
+

角色列表 - +
+ + + +

-
+ +
+ + 正在生成: {{ voiceTaskQueue.find(t => t.status === 'running')?.char.name || '...' }} + 排队中: {{ voiceTaskQueue.length }} 个任务 + (剩余 {{ voiceTaskQueue.filter(t => t.status === 'queued').length }} 个) +
+
-
+
- +
@@ -758,8 +1755,8 @@

@@ -786,116 +1783,137 @@

-
暂无角色,请点击新增 +
暂无角色,请点击新增
-
+
-
-
-

1. 输入原文 / 小说片段

-
- - -
- -
-
AI 深度分析
- - +
+
+
+
主输入区
+

1. 输入原文 / 小说片段

+
- -
-
插入控制块
-
- - - -
-
- - - - (若需关闭,可从Prompt管理中删除背景图片块相关提示词) +
+ + +
+
+
分析
+
+ + +
-
- - -
-
配音与播放
- -
- - +
+
+
插块
+
+ 背景图 + + +
+
+
+ + + +
-
- - +
+
生成与播放
+
+ +
+ + + +
+ +
+
+ 当前筛选 {{ filteredDialogueLines.length }} 条,主按钮将直接重配 +
+
+ 已选中第 {{ selectedLineIndex + 1 }} 行,主按钮将从此处开始 +
@@ -903,33 +1921,62 @@

1. 输入原文 / 小说片段

-
-

2. 脚本台词列表 ({{ scriptLines.length }} 行)

+
+
+

+ 2. 脚本台词列表 + + ({{ scriptListCountLabel }} 行) + +

+ + 当前筛选 {{ filteredDialogueLines.length }} 条,主按钮可直接重配 + +
+
+ 角色筛选 + + + + 当前显示 {{ filteredDialogueLines.length }} 条筛选台词 + +
-
-
+
+ 当前角色筛选下没有可显示的台词。 +
+
+ :class="['flex flex-wrap items-center gap-3 p-3 rounded-lg border mb-2 transition-all', selectedLineIndex === renderedScriptLineIndexes[index] ? 'script-bgm-selected' : 'bg-purple-50/50 border-purple-200', currentSequenceIndex === renderedScriptLineIndexes[index] ? 'ring-2 ring-green-500' : '']">
- -
{{ index + 1 }}
- + +
{{ renderedScriptLineIndexes[index] + 1 }}
+
@@ -957,8 +2004,9 @@

2. 脚本台词列表 ({{ scriptLin

- -
{{ index + 1 }}
- + +
{{ renderedScriptLineIndexes[index] + 1 }}
+
@@ -987,9 +2035,9 @@

2. 脚本台词列表 ({{ scriptLin
背景图片块
-

-
@@ -1025,7 +2073,7 @@

2. 脚本台词列表 ({{ scriptLin LLM 图片提示词(中文)

@@ -1041,17 +2089,17 @@

2. 脚本台词列表 ({{ scriptLin
+ :class="['flex flex-col gap-2 p-3 rounded-lg mb-2 transition-all group cursor-pointer border', selectedLineIndex === renderedScriptLineIndexes[index] ? 'script-line-selected' : 'bg-white border-slate-200 shadow-sm hover:bg-slate-50', currentSequenceIndex === renderedScriptLineIndexes[index] ? 'ring-2 ring-green-500' : '']">
- -
{{ index + 1 }}
- + +
{{ renderedScriptLineIndexes[index] + 1 }}
+
@@ -1151,7 +2199,7 @@

2. 脚本台词列表 ({{ scriptLin
- @@ -1191,7 +2239,7 @@

2. 脚本台词列表 ({{ scriptLin
-

-
@@ -1262,45 +2309,51 @@

2. 脚本台词列表 ({{ scriptLin - +

+
+
+ 正在接近底部时自动加载更多台词(已加载 {{ renderedScriptLines.length }} / {{ filteredScriptLines.length }}) +
+
+
+
-
+

3. AI 原始输出 (调试用)

{{ rawAnalysisResult }}
+ class="bg-slate-800 text-slate-200 p-3 sm:p-4 rounded-lg text-[11px] sm:text-xs overflow-x-auto whitespace-pre-wrap max-h-[16rem] sm:max-h-[20rem] xl:max-h-[26rem]">{{ rawAnalysisResult }}
-
-
+

自定义 Prompt 模板

+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存设置 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">恢复默认
@@ -1324,15 +2377,15 @@

1. 剧本拆分与分析 Promp ${rawScript}

-
+

2. 角色音色分析 Prompt

+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存设置 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">恢复默认
@@ -1352,15 +2405,15 @@

2. 角色音色分析 Prompt

可用变量: ${charName}, ${rawScript}
-
+

3. Qwen 音色生成参考音频 文本模板

+ class="px-5 py-2.5 rounded-xl text-sm font-bold transition-all btn-pri">保存设置 + class="px-5 py-2 rounded-xl text-xs font-bold transition-all btn-sec">恢复默认
@@ -1382,7 +2435,7 @@

3. Qwen 音色生成参考音频

-

+

本网站由sdsds222制作,点击此处访问个人主页 @@ -1392,10 +2445,37 @@

3. Qwen 音色生成参考音频