diff --git a/src/client/voice/VoiceBroadcast.js b/src/client/voice/VoiceBroadcast.js index 963342941..bce054583 100644 --- a/src/client/voice/VoiceBroadcast.js +++ b/src/client/voice/VoiceBroadcast.js @@ -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 */ diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js index 304769145..4a064a5c1 100644 --- a/src/client/voice/VoiceConnection.js +++ b/src/client/voice/VoiceConnection.js @@ -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