想要连接两个音频文件。 我使用了一个名为 audioconcate 的 npm,但是当我安装和配置以下代码时,我遇到了以下错误
Error: Error: Cannot find ffmpeg
at E:VoiceManregisterchecknode_modulesfluent-ffmpeglibprocessor.js:136:22
at E:VoiceManregisterchecknode_modulesfluent-ffmpeglibcapabilities.js:123:9
at E:VoiceManregisterchecknode_modulesasyncdistasync.js:356:16
at nextTask (E:VoiceManregisterchecknode_modulesasyncdistasync.js:5057:29)
at E:VoiceManregisterchecknode_modulesasyncdistasync.js:5064:13
at apply (E:VoiceManregisterchecknode_modulesasyncdistasync.js:21:25)
at E:VoiceManregisterchecknode_modulesasyncdistasync.js:56:12
at E:VoiceManregisterchecknode_modulesasyncdistasync.js:840:16
at E:VoiceManregisterchecknode_modulesfluent-ffmpeglibcapabilities.js:116:11
at E:VoiceManregisterchecknode_modulesfluent-ffmpeglibutils.js:223:16
ffmpeg stderr: undefined
这是我正在使用的代码:(所有音频文件也在同一文件夹中(
var audioconcat = require('audioconcat'(
var songs = [
'a(1).mp3',
'a(2).mp3',
'a(3).mp3'
]
audioconcat(songs)
.concat('all.mp3')
.on('start', function (command) {
console.log('ffmpeg process started:', command)
})
.on('error', function (err, stdout, stderr) {
console.error('Error:', err)
console.error('ffmpeg stderr:', stderr)
})
.on('end', function (output) {
console.error('Audio created in:', output)
})
看起来你没有安装 ffmpeg,这是该软件包的要求。
要求
带有附加编译标志的 FFMPEG --enable-libass --enable-libmp3lame
https://www.npmjs.com/package/audioconcat