StreamOpusEncoder<T> class

Used to encode a stream of pcm data to opus frames of constant time. Each StreamOpusEncoder MUST ONLY be used once!

Inheritance

Constructors

StreamOpusEncoder.bytes({required FrameTime frameTime, required bool floatInput, required int sampleRate, required int channels, required Application application, bool fillUpLastFrame = true, bool copyOutput = true})
Creates a new StreamOpusEncoder that expects its input Lists to be bytes in form of Uint8List.
StreamOpusEncoder.float({required FrameTime frameTime, required int sampleRate, required int channels, required Application application, bool fillUpLastFrame = true, bool copyOutput = true})
Creates a new StreamOpusEncoder that expects its input Lists to be Float32List.
StreamOpusEncoder.s16le({required FrameTime frameTime, required int sampleRate, required int channels, required Application application, bool fillUpLastFrame = true, bool copyOutput = true})
Creates a new StreamOpusEncoder that expects its input Lists to be Int16List.

Properties

application → Application
The kind of application for which this encoders output is used.
no setter
channels → int
Number of channels, must be 1 for mono or 2 for stereo.
no setter
copyOutput → bool
If true, the encoded output is copied into dart memory befor passig it to any consumers.
final
fillUpLastFrame → bool
If the underlying stream is closed and this is true, the missing samples are filled up with zero to produce a final frame.
final
floats → bool
Indicates if the input data is interpreted as floats (true) or as s16le (false).
final
frameTime → FrameTime
The frames time determines, how much data need to be buffered before producing an encoded opus packet.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampleRate → int
The sample rate in Hz for this encoder.
no setter

Methods

bind(Stream<List<T>> stream) → Stream<Uint8List>
Transforms the provided stream.
override
cast<RS, RT>() → StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
destroy() → void
Manually destroys this encoder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited