feat(tts): 添加语音剪气口功能以去除首尾静音
- 集成 ffmpeg 实现自动检测并切除音频首尾静音段 - 新增 trimSilence 和 getAudioDuration 辅助函数 - 裁剪后若时长缩短则替换原音频文件,使片段时长更贴近真实语长 - 更新剪映草稿路径和 capcut-mate 目录配置
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"jianyingDraftPath": "/Users/lc/Movies/JianyingPro/User Data/Projects/com.lveditor.draft",
|
||||
"capcutMateDir": "C:/Users/45070/capcut-mate",
|
||||
"jianyingDraftPath": "C:/Users/45070/AppData/Local/JianyingPro/User Data/Projects/com.lveditor.draft",
|
||||
"capcutMateDir": "/Users/lc/capcut-mate",
|
||||
"capcutMateApiBase": "http://capcut.muyetools.cn/openapi/capcut-mate/v1",
|
||||
"imgbbApiKey": "deprecated",
|
||||
"geminiApiBaseUrl": "https://yunwu.ai",
|
||||
@@ -34,4 +34,4 @@
|
||||
"ttsModel": "cosyvoice-v3.5-plus",
|
||||
"ttsVoice": "cosyvoice-v3.5-plus-bailian-fa8787c0f70b4ba2a907c35511e6a6f6",
|
||||
"ttsLanguage": "Chinese"
|
||||
}
|
||||
}
|
||||
@@ -155,6 +155,9 @@ function registerDraft(draftId, draftName, totalDurationUs) {
|
||||
const rootMetaPath = path.join(jianyingDraftPath, 'root_meta_info.json')
|
||||
const draftDir = path.join(jianyingDraftPath, draftId)
|
||||
|
||||
if (!fs.existsSync(rootMetaPath)) {
|
||||
fs.writeFileSync(rootMetaPath, JSON.stringify({ all_draft_store: [] }, null, 4), 'utf-8')
|
||||
}
|
||||
const rootMeta = JSON.parse(fs.readFileSync(rootMetaPath, 'utf-8'))
|
||||
if (rootMeta.all_draft_store.some(d => d.draft_fold_path === winPath(draftDir))) {
|
||||
console.log(' 已注册,跳过')
|
||||
|
||||
Reference in New Issue
Block a user