mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Add VoiceBroadcast#playArbitraryInput and VoiceConnection#playArbitraryInput
This commit is contained in:
@@ -252,6 +252,17 @@ class VoiceBroadcast extends EventEmitter {
|
|||||||
return this;
|
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
|
* Pauses the entire broadcast - all dispatchers also pause
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -241,6 +241,17 @@ class VoiceConnection extends EventEmitter {
|
|||||||
return this.player.playUnknownStream(file, options);
|
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.
|
* Plays and converts an audio stream in the voice connection.
|
||||||
* @param {ReadableStream} stream The audio stream to play
|
* @param {ReadableStream} stream The audio stream to play
|
||||||
|
|||||||
Reference in New Issue
Block a user