Add passes to streaming voice

This commit is contained in:
Amish Shah
2016-09-11 18:49:13 +01:00
parent d365eb95e2
commit 9059eb13a2
6 changed files with 26 additions and 17 deletions

View File

@@ -24,8 +24,8 @@ class VoiceConnectionPlayer extends EventEmitter {
};
}
convertStream(stream, { seek = 0, volume = 1 } = {}) {
const options = { seek: seek, volume: volume };
convertStream(stream, { seek = 0, volume = 1, passes = 1 } = {}) {
const options = { seek, volume, passes };
const encoder = this.converterEngine.createConvertStream(options.seek);
const pipe = stream.pipe(encoder.stdin, { end: false });
pipe.on('unpipe', () => {
@@ -95,8 +95,8 @@ class VoiceConnectionPlayer extends EventEmitter {
});
}
playPCMStream(pcmStream, { seek = 0, volume = 1 } = {}) {
const options = { seek: seek, volume: volume };
playPCMStream(pcmStream, { seek = 0, volume = 1, passes = 1 } = {}) {
const options = { seek, volume, passes };
const dispatcher = new StreamDispatcher(this, pcmStream, this._streamingData, options);
dispatcher.on('speaking', value => this.setSpeaking(value));
dispatcher.on('end', () => this.killStream(pcmStream));