mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
Clean up PR a bit
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -200,10 +200,21 @@ class VoiceConnection extends EventEmitter {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Options that can be passed to stream-playing methods:
|
||||
* ```js
|
||||
* {
|
||||
* seek: 0,
|
||||
* volume: 1
|
||||
* };
|
||||
* ```
|
||||
* @typedef {Object} StreamOptions
|
||||
*/
|
||||
|
||||
/**
|
||||
* Play the given file in the voice connection
|
||||
* @param {string} file The path to the file
|
||||
* @param {Object} [options] Optional streamOptions object. Currently accepts seek and volume properties.
|
||||
* @param {StreamOptions} [options] Options for playing the stream
|
||||
* @returns {StreamDispatcher}
|
||||
* @example
|
||||
* // play files natively
|
||||
@@ -221,7 +232,7 @@ class VoiceConnection extends EventEmitter {
|
||||
/**
|
||||
* Plays and converts an audio stream in the voice connection
|
||||
* @param {ReadableStream} stream The audio stream to play
|
||||
* @param {Object} [options] Optional streamOptions object. Currently accepts seek and volume properties.
|
||||
* @param {StreamOptions} [options] Options for playing the stream
|
||||
* @returns {StreamDispatcher}
|
||||
* @example
|
||||
* // play streams using ytdl-core
|
||||
@@ -242,7 +253,7 @@ class VoiceConnection extends EventEmitter {
|
||||
/**
|
||||
* Plays a stream of 16-bit signed stereo PCM at 48KHz.
|
||||
* @param {ReadableStream} stream The audio stream to play.
|
||||
* @param {Object} [options] Optional streamOptions object. Currently accepts seek and volume properties.
|
||||
* @param {StreamOptions} [options] Options for playing the stream
|
||||
* @returns {StreamDispatcher}
|
||||
*/
|
||||
playConvertedStream(stream, { seek = 0, volume = 1 }) {
|
||||
|
||||
@@ -20,7 +20,7 @@ class FfmpegConverterEngine extends ConverterEngine {
|
||||
'-i', '-',
|
||||
'-f', 's16le',
|
||||
'-ar', '48000',
|
||||
'-ss', seek.toString(),
|
||||
'-ss', String(seek),
|
||||
'pipe:1',
|
||||
], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||
encoder.on('error', e => this.handleError(encoder, e));
|
||||
|
||||
Reference in New Issue
Block a user