Class: OpusStream

(protected) opus.OpusStream(optionsopt)

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!**

Constructor

(protected) new OpusStream(optionsopt)

Creates a new Opus transformer.
Parameters:
Name Type Attributes Description
options Object <optional>
options that you would pass to a regular Transform stream
Source:

Extends

  • TransformStream

Members

(static, readonly) type :string

Returns the Opus module being used - `opusscript`, `node-opus`, or `@discordjs/opus`.
Type:
  • string
Source:
Example
console.log(`Using Opus module ${prism.opus.Encoder.type}`);

Methods

setBitrate(bitrate)

Sets the bitrate of the stream.
Parameters:
Name Type Description
bitrate number the bitrate to use use, e.g. 48000
Source:

setFEC(enabled)

Enables or disables forward error correction.
Parameters:
Name Type Description
enabled boolean whether or not to enable FEC.
Source:

setPLP(percentageopt)

Sets the expected packet loss over network transmission.
Parameters:
Name Type Attributes Description
percentage number <optional>
a percentage (represented between 0 and 1)
Source: