mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +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);
|
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.
|
* Creates a VoiceReceiver so you can start listening to voice data. It's recommended to only create one of these.
|
||||||
* @returns {VoiceReceiver}
|
* @returns {VoiceReceiver}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class DefaultPlayer extends BasePlayer {
|
|||||||
const dispatcher = this.playPCMStream(pcmStream);
|
const dispatcher = this.playPCMStream(pcmStream);
|
||||||
return dispatcher;
|
return dispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = DefaultPlayer;
|
module.exports = DefaultPlayer;
|
||||||
|
|||||||
Reference in New Issue
Block a user