Add VoiceBroadcast#playArbitraryInput and VoiceConnection#playArbitraryInput

This commit is contained in:
Amish Shah
2016-12-30 19:13:25 +00:00
parent ac62a58f47
commit eacbfbd520
2 changed files with 22 additions and 0 deletions

View File

@@ -252,6 +252,17 @@ class VoiceBroadcast extends EventEmitter {
return this;
}
/**
* Play an arbitrary input that can be [handled by ffmpeg](https://ffmpeg.org/ffmpeg-protocols.html#Description)
* @param {string} input the arbitrary input
* @param {StreamOptions} [options] Options for playing the stream
* @returns {VoiceBroadcast}
*/
playArbitraryInput(input, { seek = 0, volume = 1, passes = 1 } = {}) {
const options = { seek, volume, passes };
return this.player.playUnknownStream(input, options);
}
/**
* Pauses the entire broadcast - all dispatchers also pause
*/

View File

@@ -241,6 +241,17 @@ class VoiceConnection extends EventEmitter {
return this.player.playUnknownStream(file, options);
}
/**
* Play an arbitrary input that can be [handled by ffmpeg](https://ffmpeg.org/ffmpeg-protocols.html#Description)
* @param {string} input the arbitrary input
* @param {StreamOptions} [options] Options for playing the stream
* @returns {StreamDispatcher}
*/
playArbitraryInput(input, { seek = 0, volume = 1, passes = 1 } = {}) {
const options = { seek, volume, passes };
return this.player.playUnknownStream(input, options);
}
/**
* Plays and converts an audio stream in the voice connection.
* @param {ReadableStream} stream The audio stream to play