Aaron copied horrible code from elsewhere

This commit is contained in:
abalabahaha
2016-03-12 22:06:30 -08:00
parent 13055f67d2
commit 930f276828
4 changed files with 13 additions and 6 deletions

View File

@@ -60,7 +60,7 @@ export default class AudioEncoder {
encodeStream(stream, options) {
return new Promise((resolve, reject) => {
this.volume = new VolumeTransformer(options.volume || 1);
this.volume = new VolumeTransformer(options.volume);
var enc = cpoc.spawn(this.getCommand(), [
'-hide_banner',
@@ -107,7 +107,7 @@ export default class AudioEncoder {
encodeFile(file, options) {
return new Promise((resolve, reject) => {
this.volume = new VolumeTransformer(options.volume || 1);
this.volume = new VolumeTransformer(options.volume);
var enc = cpoc.spawn(this.getCommand(), [
'-hide_banner',

View File

@@ -12,6 +12,7 @@ import dns from "dns";
import udp from "dgram";
import AudioEncoder from "./AudioEncoder";
import VoicePacket from "./VoicePacket";
import VolumeTransformer from "./VolumeTransformer";
import StreamIntent from "./StreamIntent";
import EventEmitter from "events";
import unpipe from "unpipe";
@@ -38,6 +39,7 @@ export default class VoiceConnection extends EventEmitter {
this.KAI = null;
this.timestamp = 0;
this.sequence = 0;
this.volume = new VolumeTransformer();
this.init();
}
@@ -107,8 +109,8 @@ export default class VoiceConnection extends EventEmitter {
if (!buffer) {
if (onWarning) {
retStream.emit("end");
self.setSpeaking(false);
retStream.emit("end");
return;
} else {
onWarning = true;