I tried merging two audio files using following command,
executeFfmpeg(`-i voice.wav -i background.wav -t ${duration+2} -filter_complex amix=inputs=2:duration=longest output.wav`)
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Merging finished !');
}).run();
But I also want to fade out the audio in the end, So to do that I tried the following code,
executeFfmpeg(`-i voice.wav -i background.wav -t ${duration+2} -vf "fade=t=out:st=${duration-1}:d=3" -filter_complex amix=inputs=2:duration=longest output.wav`)
.on('error', function(err) {
console.log('An error occurred: ' + err.message);
})
.on('end', function() {
console.log('Merging finished !');
}).run();
But the background audio volume is unchanged. Working with ffmpeg for the first time. So don't know what's happening. Need help :(