mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
voice: update prism and fix framesize to work for opusscript
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
"unpkg": "./webpack/discord.min.js",
|
||||
"dependencies": {
|
||||
"pako": "^1.0.0",
|
||||
"prism-media": "hydrabolt/prism-media",
|
||||
"prism-media": "^0.2.0",
|
||||
"snekfetch": "^3.6.0",
|
||||
"tweetnacl": "^1.0.0",
|
||||
"ws": "^4.0.0"
|
||||
|
||||
@@ -56,7 +56,7 @@ class BasePlayer extends EventEmitter {
|
||||
|
||||
playPCMStream(stream, options, streams = {}) {
|
||||
this.destroyDispatcher();
|
||||
const opus = streams.opus = new prism.opus.Encoder({ channels: 2, rate: 48000, frameSize: 1920 });
|
||||
const opus = streams.opus = new prism.opus.Encoder({ channels: 2, rate: 48000, frameSize: 960 });
|
||||
if (options && options.volume === false) {
|
||||
stream.pipe(opus);
|
||||
return this.playOpusStream(opus, options, streams);
|
||||
|
||||
@@ -44,7 +44,7 @@ class VoiceReceiver extends EventEmitter {
|
||||
if (!user) throw new Error('VOICE_USER_MISSING');
|
||||
const stream = this.packets.makeStream(user.id);
|
||||
if (mode === 'pcm') {
|
||||
const decoder = new prism.opus.Decoder({ channels: 2, rate: 48000, frameSize: 1920 });
|
||||
const decoder = new prism.opus.Decoder({ channels: 2, rate: 48000, frameSize: 960 });
|
||||
stream.pipe(decoder);
|
||||
return decoder;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user