mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Add playPCMStream
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -240,6 +240,17 @@ class VoiceConnection extends EventEmitter {
|
||||
return this.player.playStream(stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Plays a stream of PCM data
|
||||
* @param {ReadableStream} pcmStream the PCM stream
|
||||
* @returns {StreamDispatcher}
|
||||
*/
|
||||
playPCMStream(pcmStream) {
|
||||
this._shutdown();
|
||||
const dispatcher = this.player.playPCMStream(pcmStream);
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a VoiceReceiver so you can start listening to voice data. It's recommended to only create one of these.
|
||||
* @returns {VoiceReceiver}
|
||||
|
||||
@@ -14,7 +14,6 @@ class DefaultPlayer extends BasePlayer {
|
||||
const dispatcher = this.playPCMStream(pcmStream);
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = DefaultPlayer;
|
||||
|
||||
Reference in New Issue
Block a user