mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 23:21:04 +00:00
Add playPCMStream
This commit is contained in:
parent
3718841c7c
commit
f2708dd26f
3 changed files with 12 additions and 2 deletions
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue