"use strict";

const FFmpegDuplex = require("./FFmpegDuplex");

module.exports = function(options) {
    options = options || {};
    if(!options.command) {
        throw new Error("Invalid converter command");
    }
    if(options.samplingRate === undefined) {
        options.samplingRate = 48000;
    }
    var inputArgs = [
        "-analyzeduration", "0",
        "-loglevel", "24",
        "-i", "-",
        "-vn"
    ];
    var outputArgs = [
        "-f", "s16le",
        "-ar", "" + options.samplingRate,
        "-ac", "2",
        "-"
    ];
    return FFmpegDuplex.spawn(options.command, inputArgs.concat(options.encoderArgs || [], outputArgs));
};

@@ -394,16 +394,33 @@
    %22-i%22,
+ options.input %7C%7C
  %22-%22,%0A  

Fix FFmpegPCMTransformer with file paths