mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Aaron copied horrible code from elsewhere
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user