GlintEncoder class
A safe wrapper around the glint MP3 encoder for use via Dart FFI.
Usage:
final encoder = GlintEncoder(sampleRate: 44100, channels: 1, bitrate: 128);
final mp3Bytes = encoder.encode(pcmSamples);
final remaining = encoder.flush();
encoder.dispose();
Constructors
Properties
- channels → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- samplesPerFrame ↔ int
-
latefinal
Methods
-
dispose(
) → void - Release all native resources. Must be called when done encoding.
-
encode(
Int16List pcm) → Uint8List - Encode one frame of interleaved 16-bit PCM samples.
-
encodeFloat(
Float32List pcm) → Uint8List - Encode one frame of interleaved 32-bit float PCM samples.
-
flush(
) → Uint8List - Flush the encoder, returning any remaining MP3 data.
-
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