Skip to content
Permalink
Browse files

fix recording export with multi-track files

  • Loading branch information...
mmckegg committed Dec 20, 2017
1 parent ddc5f9c commit 5f2cbba3c84324aaa319d58e0ce4f2457babf057
Showing with 6 additions and 1 deletion.
  1. +6 −1 scripts/export-recording.js
@@ -14,9 +14,14 @@ var base = Path.basename(input, '.json')

fs.readdir(dir, function (err, files) {
if (err) throw err
files = files.filter(f => f.startsWith(base + '-'))
files = files.filter(f => matches(base, f))

fs.writeFileSync(output + '.txt', files.map(x => `file '${Path.join(dir, x)}'`).join('\n'))
var args = ['-f', 'concat', '-safe', '0', '-i', output + '.txt', '-af', 'volume=0.8', output]
spawn('ffmpeg', args, {stdio: 'inherit'})
})

function matches (base, fileName) {
var match = fileName.match(/^(.+)-([0-9]+)\.wav$/)
return (match && match[1] === base)
}

0 comments on commit 5f2cbba

Please sign in to comment.
You can’t perform that action at this time.