mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 19:20:42 +00:00
Set the volume default to 1 as @hydrabolt intended, fixes #154
This commit is contained in:
parent
7fb39b6dc0
commit
358c40c355
2 changed files with 4 additions and 4 deletions
|
|
@ -81,7 +81,7 @@ var AudioEncoder = (function () {
|
||||||
AudioEncoder.prototype.encodeStream = function encodeStream(stream, options) {
|
AudioEncoder.prototype.encodeStream = function encodeStream(stream, options) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', '-', '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 0.25), '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', '-', '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 1), '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||||
|
|
||||||
stream.pipe(enc.stdin);
|
stream.pipe(enc.stdin);
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ var AudioEncoder = (function () {
|
||||||
AudioEncoder.prototype.encodeFile = function encodeFile(file, options) {
|
AudioEncoder.prototype.encodeFile = function encodeFile(file, options) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', file, '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 0.25), '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
var enc = _child_process2["default"].spawn(self.getCommand(), ['-loglevel', '0', '-i', file, '-f', 's16le', '-ar', '48000', '-af', 'volume=' + (options.volume || 1), '-ac', 2, 'pipe:1'], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||||
|
|
||||||
enc.stdout.once("readable", function () {
|
enc.stdout.once("readable", function () {
|
||||||
resolve({
|
resolve({
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ export default class AudioEncoder {
|
||||||
'-i', '-',
|
'-i', '-',
|
||||||
'-f', 's16le',
|
'-f', 's16le',
|
||||||
'-ar', '48000',
|
'-ar', '48000',
|
||||||
'-af', 'volume=' + (options.volume || 0.25),
|
'-af', 'volume=' + (options.volume || 1),
|
||||||
'-ac', 2,
|
'-ac', 2,
|
||||||
'pipe:1'
|
'pipe:1'
|
||||||
], {stdio: ['pipe', 'pipe', 'ignore']});
|
], {stdio: ['pipe', 'pipe', 'ignore']});
|
||||||
|
|
@ -99,7 +99,7 @@ export default class AudioEncoder {
|
||||||
'-i', file,
|
'-i', file,
|
||||||
'-f', 's16le',
|
'-f', 's16le',
|
||||||
'-ar', '48000',
|
'-ar', '48000',
|
||||||
'-af', 'volume=' + (options.volume || 0.25),
|
'-af', 'volume=' + (options.volume || 1),
|
||||||
'-ac', 2,
|
'-ac', 2,
|
||||||
'pipe:1'
|
'pipe:1'
|
||||||
], { stdio: ['pipe', 'pipe', 'ignore'] });
|
], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue