Class: Decoder

opus.Decoder()

An Opus decoder stream. Note that any stream you pipe into this must be in [object mode](https://nodejs.org/api/stream.html#stream_object_mode) and should output Opus packets.

Constructor

new Decoder()

Source:
Example
const decoder = new prism.opus.Decoder({ frameSize: 960, channels: 2, rate: 48000 });
input.pipe(decoder);
// decoder will now output PCM audio

Extends

Methods

setBitrate(bitrate)

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

setFEC(enabled)

Enables or disables forward error correction.
Parameters:
Name Type Description
enabled boolean whether or not to enable FEC.
Inherited From:
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)
Inherited From:
Source: