Add playPCMStream

This commit is contained in:
Amish Shah
2016-08-27 15:48:05 +01:00
parent 3718841c7c
commit f2708dd26f
3 changed files with 12 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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}

View File

@@ -14,7 +14,6 @@ class DefaultPlayer extends BasePlayer {
const dispatcher = this.playPCMStream(pcmStream);
return dispatcher;
}
}
module.exports = DefaultPlayer;