1
This commit is contained in:
@@ -124,8 +124,7 @@ function locateFfmpeg() {
|
||||
return whichSync(name);
|
||||
}
|
||||
|
||||
async function ffmpegExtractAudio(videoPath) {
|
||||
const dest = tempPath("audio", "wav");
|
||||
function requireFfmpeg() {
|
||||
const ffmpeg = locateFfmpeg();
|
||||
if (!ffmpeg) {
|
||||
throw new Error(
|
||||
@@ -133,6 +132,12 @@ async function ffmpegExtractAudio(videoPath) {
|
||||
"或在环境变量中设置 AICLIENT_FFMPEG_PATH(桌面端会在启动 Node 时自动注入已解析路径)",
|
||||
);
|
||||
}
|
||||
return ffmpeg;
|
||||
}
|
||||
|
||||
async function ffmpegExtractAudio(videoPath) {
|
||||
const dest = tempPath("audio", "wav");
|
||||
const ffmpeg = requireFfmpeg();
|
||||
await runCommand(ffmpeg, [
|
||||
"-y",
|
||||
"-i",
|
||||
@@ -468,7 +473,8 @@ async function qwenTtsSynthesize(opts) {
|
||||
const wavOut = path.join(parsed.dir, `${parsed.name}_merged.wav`);
|
||||
concatWavFiles(segmentPaths, wavOut);
|
||||
try {
|
||||
await runCommand(exeName(), [
|
||||
const ffmpeg = requireFfmpeg();
|
||||
await runCommand(ffmpeg, [
|
||||
"-y",
|
||||
"-i",
|
||||
wavOut,
|
||||
|
||||
Reference in New Issue
Block a user