mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +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
|
* Play the given file in the voice connection
|
||||||
* @param {string} file The path to the file
|
* @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}
|
* @returns {StreamDispatcher}
|
||||||
* @example
|
* @example
|
||||||
* // play files natively
|
* // play files natively
|
||||||
@@ -221,7 +232,7 @@ class VoiceConnection extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* 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
|
||||||
* @param {Object} [options] Optional streamOptions object. Currently accepts seek and volume properties.
|
* @param {StreamOptions} [options] Options for playing the stream
|
||||||
* @returns {StreamDispatcher}
|
* @returns {StreamDispatcher}
|
||||||
* @example
|
* @example
|
||||||
* // play streams using ytdl-core
|
* // play streams using ytdl-core
|
||||||
@@ -242,7 +253,7 @@ class VoiceConnection extends EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* Plays a stream of 16-bit signed stereo PCM at 48KHz.
|
* Plays a stream of 16-bit signed stereo PCM at 48KHz.
|
||||||
* @param {ReadableStream} stream The audio stream to play.
|
* @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}
|
* @returns {StreamDispatcher}
|
||||||
*/
|
*/
|
||||||
playConvertedStream(stream, { seek = 0, volume = 1 }) {
|
playConvertedStream(stream, { seek = 0, volume = 1 }) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class FfmpegConverterEngine extends ConverterEngine {
|
|||||||
'-i', '-',
|
'-i', '-',
|
||||||
'-f', 's16le',
|
'-f', 's16le',
|
||||||
'-ar', '48000',
|
'-ar', '48000',
|
||||||
'-ss', seek.toString(),
|
'-ss', String(seek),
|
||||||
'pipe:1',
|
'pipe:1',
|
||||||
], { stdio: ['pipe', 'pipe', 'ignore'] });
|
], { stdio: ['pipe', 'pipe', 'ignore'] });
|
||||||
encoder.on('error', e => this.handleError(encoder, e));
|
encoder.on('error', e => this.handleError(encoder, e));
|
||||||
|
|||||||
Reference in New Issue
Block a user