voice fixes

This commit is contained in:
Amish Shah
2015-12-05 20:57:08 +00:00
parent de19475ae0
commit d122184b6b
6 changed files with 87 additions and 50 deletions

View File

@@ -67,8 +67,7 @@ var AudioEncoder = (function () {
var self = this;
return new Promise(function (resolve, reject) {
var enc = _child_process2["default"].spawn(self.getCommand(), ["-f", "s16le", "-ar", "48000", "-ac", "1", // this can be 2 but there's no point, discord makes it mono on playback, wasted bandwidth.
"-af", "volume=1", "pipe:1", "-i", "-"]);
var enc = _child_process2["default"].spawn(self.getCommand(), ['-i', "-", '-f', 's16le', '-ar', '48000', '-ac', 1, 'pipe:1']);
stream.pipe(enc.stdin);
@@ -102,8 +101,7 @@ var AudioEncoder = (function () {
var self = this;
return new Promise(function (resolve, reject) {
var enc = _child_process2["default"].spawn(self.getCommand(), ["-f", "s16le", "-ar", "48000", "-ac", "1", // this can be 2 but there's no point, discord makes it mono on playback, wasted bandwidth.
"-af", "volume=1", "pipe:1", "-i", file]);
var enc = _child_process2["default"].spawn(self.getCommand(), ['-i', file, '-f', 's16le', '-ar', '48000', '-ac', 1, 'pipe:1']);
enc.stdout.once("readable", function () {
callback(null, {
@@ -117,11 +115,13 @@ var AudioEncoder = (function () {
});
enc.stdout.on("end", function () {
console.log("end");
callback("end");
reject("end");
});
enc.stdout.on("close", function () {
console.log("close");
callback("close");
reject("close");
});