Clean up PR a bit

This commit is contained in:
Schuyler Cebulskie
2016-09-08 22:59:10 -04:00
parent f7a542f12b
commit 9682adb9fe
3 changed files with 16 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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 }) {

View File

@@ -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));