Discord Player

OpusEncoder

An Opus encoder stream. Outputs opus packets in object mode.

OpusEncoder extends OpusStream

An Opus encoder stream.

Outputs opus packets in object mode.

new OpusEncoder(options)();
ParameterTypeOptionalDescription
optionsIOpusStreamInitoptions that you would pass to a regular OpusStream, plus a few more:

Properties

public _buffer: any

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.

ParameterTypeOptionalDescription
bitratenumberthe bitrate to use use, e.g. 48000

public setFEC(enabled): void

Enables or disables forward error correction.

ParameterTypeOptionalDescription
enabledbooleanwhether or not to enable FEC.

public setPLP(percentage?): void

Sets the expected packet loss over network transmission.

ParameterTypeOptionalDescription
percentagenumbera percentage (represented between 0 and 1)

On this page