Fix arbitrary ffmpeg

This commit is contained in:
abalabahaha
2016-10-02 12:44:59 +09:00
parent c00d209014
commit 76dd4f74da
4 changed files with 28 additions and 22 deletions

View File

@@ -124,11 +124,11 @@ var AudioEncoder = (function () {
});
};
AudioEncoder.prototype.encodeArbitraryFFmpeg = function encodeArbitraryFFmpeg(ffmpegOptions, volume) {
AudioEncoder.prototype.encodeArbitraryFFmpeg = function encodeArbitraryFFmpeg(ffmpegOptions, options) {
var _this3 = this;
return new Promise(function (resolve, reject) {
_this3.volume = new _VolumeTransformer2["default"](volume);
_this3.volume = new _VolumeTransformer2["default"](options.volume);
var command = _this3.getCommand();
@@ -136,8 +136,8 @@ var AudioEncoder = (function () {
if (!command) return reject(new Error('FFMPEG not found. Make sure it is installed and in path.'));
// add options discord.js needs
var options = ffmpegOptions.concat(['-f', 's16le', '-ar', '48000', '-ac', 2, 'pipe:1']);
var enc = _child_process2["default"].spawn(command, options);
var ffmpegOptions = ffmpegOptions.concat(['-f', 's16le', '-ar', '48000', '-ac', 2, 'pipe:1']);
var enc = _child_process2["default"].spawn(command, ffmpegOptions);
_this3.hookEncodingProcess(resolve, reject, enc);
});