Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
amishshah committed Feb 20, 2019
1 parent 6aa792f commit efbbfbc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/client/voice/player/BasePlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class BasePlayer extends EventEmitter {
stream.pipe(opus);
return this.playOpusStream(opus, options, streams);
}
const volume = streams.volume = new prism.VolumeTransformer16LE({ volume: options ? options.volume : 1 });
stream.pipe(volume).pipe(opus);
streams.volume = new prism.VolumeTransformer({ type: 's16le', volume: options ? options.volume : 1 });
stream.pipe(streams.volume).pipe(opus);
return this.playOpusStream(opus, options, streams);
}

Expand All @@ -77,10 +77,10 @@ class BasePlayer extends EventEmitter {
if (options.volume !== false && !streams.input) {
streams.input = stream;
const decoder = new prism.opus.Decoder({ channels: 2, rate: 48000, frameSize: 960 });
const volume = streams.volume = new prism.VolumeTransformer16LE({ volume: options ? options.volume : 1 });
streams.volume = new prism.VolumeTransformer({ type: 's16le', volume: options ? options.volume : 1 });
streams.opus = stream
.pipe(decoder)
.pipe(volume)
.pipe(streams.volume)
.pipe(new prism.opus.Encoder({ channels: 2, rate: 48000, frameSize: 960 }));
}
const dispatcher = this.createDispatcher(options, streams);
Expand Down

0 comments on commit efbbfbc

Please sign in to comment.