I know this thread is a few months old but I thought I would still answer it since I found how to do it and if anyone ever finds this post like I did they will have the answer.
const command = new FfmpegCommand();
//create audio file with voice and engine sound under.
await command
.addInput(inputFilePath)
.addInput('./audio/utility/RB16BengineOnboard.mp3').seekInput(40)
.complexFilter([{
filter: 'volume',
options: ['1.0'],
inputs: "0:0",
outputs: "[s1]"
},
{
filter: 'volume',
options: ['0.15'],
inputs: "1:0",
outputs: "[s2]"
},
{
filter: 'amix',
inputs: ["[s1]","[s2]"],
options: ['duration=first','dropout_transition=0']
}]).output('./audio/temp/overlayed.mp3').on('error', function(err) {
console.log(err);
})
.on('end', function() {
console.log('Amixed audio files together.');
})
.run();
For the inputs: "0:0" the first 0 represents the first addInput file a and with the second 0 it represents the audio track of that file.
as stated here:
this thread about ffmpeg audio files
the rest of the code is pretty self explanatory as volume well it's the volume and the outputs names the output of that filter so it can be used later on in the code as an input for the amix filter.