OpusStream
Takes a stream of Opus data and outputs a stream of PCM data, or the inverse.
OpusStream extends Transform
Takes a stream of Opus data and outputs a stream of PCM data, or the inverse. You shouldn't directly instantiate this class, see opus.Encoder and opus.Decoder instead!
Properties
public _options: any
public _required: any
public encoder: any
public type: any
Returns the Opus module being used - mediaplex
, opusscript
, node-opus
, or @discordjs/opus
.
Methods
public setBitrate(bitrate): void
Sets the bitrate of the stream.
Parameter | Type | Optional | Description |
---|---|---|---|
bitrate | number | ❌ | the bitrate to use use, e.g. 48000 |
public setFEC(enabled): void
Enables or disables forward error correction.
Parameter | Type | Optional | Description |
---|---|---|---|
enabled | boolean | ❌ | whether or not to enable FEC. |
public setPLP(percentage?): void
Sets the expected packet loss over network transmission.
Parameter | Type | Optional | Description |
---|---|---|---|
percentage | number | ✅ | a percentage (represented between 0 and 1) |