From 329dc433fb01ef3a8cf99a497859f5178412a33b Mon Sep 17 00:00:00 2001 From: linyuchen Date: Mon, 26 Feb 2024 23:22:34 +0800 Subject: [PATCH] refactor: ffmpeg setting ui --- src/main/main.ts | 2 +- src/renderer.ts | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index dd61f64..f7dfbc6 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -326,7 +326,7 @@ function onLoad() { // 检查ffmpeg checkFFMPEG(config.ffmpeg).then(exist => { if (!exist) { - llonebotError.ffmpegError = `环境变量${process.env.PATH}中不存在ffmpeg,音频只能发送wav和silk` + llonebotError.ffmpegError = `没有找到ffmpeg,音频只能发送wav和silk` } }) if (config.ob11.enableHttp) { diff --git a/src/renderer.ts b/src/renderer.ts index 9e647b7..7910a6e 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -117,19 +117,20 @@ async function onSettingWindowCreated(view: Element) { Access Token + + + ffmpeg路径 + + + + - - - ffmpeg路径 - - - - +
消息上报数据类型 @@ -331,7 +332,8 @@ async function onSettingWindowCreated(view: Element) { doc.getElementById("selectFFMPEG")?.addEventListener("click", ()=>{ window.llonebot.selectFile().then(selectPath=>{ if (selectPath){ - (document.getElementById("ffmpegPath") as HTMLInputElement).value = selectPath; + config.ffmpeg = (document.getElementById("ffmpegPath") as HTMLInputElement).value = selectPath; + // window.llonebot.setConfig(config); } }); })