Skip to content
sb-dorPublic

About

Audio for Dart & Flutter with a Rust core: decode, tags, cover art, waveforms, trim, mix, fade, normalize, resample, save as WAV. Dart API over FFI and WebAssembly; no FFmpeg, every platform and the web.

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Frustbite

CI License: MIT Docs pub package

frustbite: the showcase app on iPhone in light and dark mode, with stream info, tags, cover art and a waveform, next to an editing example

Read and edit audio in Dart and Flutter: info, tags, cover art, waveforms, PCM, a lazy editing pipeline with WAV, FLAC and Opus output, and tag writing, powered by a Rust core through FFI and WebAssembly.

  • Decodes MP3, AAC-LC (M4A, ADTS), ALAC, FLAC, Vorbis, Opus and WAV
  • Waveforms (peak or RMS) with bounded memory, even for hour-long files
  • Tags and embedded cover art, read and written: into the files frustbite encodes, and into existing MP3, M4A, AAC, FLAC, Ogg, WAV and Opus CAF files without re-encoding (writeTags, writeTagsToFile, atomic in place)
  • Editing in one native call: trim, join with crossfades, mix, fade, normalize, resample, mono/stereo, silence trimming and detection
  • Encoding: save as WAV (16/24-bit or float), FLAC or Opus (Ogg or CAF), with encode and saveAs
  • Async: waveformAsync, decodeAsync, renderAsync and friends run on a background isolate
  • Android, iOS, macOS, Linux, Windows and the web (dart2js and dart2wasm)
  • Pure Rust core with no FFmpeg and no C codecs

Read the documentation or see the package README for API usage and the roadmap.

New to audio, Rust or FFI? The developer guide (на русском) explains how frustbite works inside, step by step.

Try it in the minimal Flutter showcase, and see how it compares with other Dart audio packages in the benchmarks.

Why frustbite

Playing audio in Flutter is easy; reading its tags, drawing its waveform, cutting it or converting it is not. The usual answer has been FFmpeg, whose common Flutter wrapper, FFmpegKit, was retired in 2025. FFmpeg adds tens of megabytes, does not run on the web and is LGPL or GPL. frustbite does these jobs with one Dart API on every platform and the web, a native library of about 2 to 4 MB, an MIT license and no dependencies on other Dart packages. People use it for:

  • waveforms and durations of voice messages;
  • tags, cover art and seek-bar waveforms in podcast and music apps;
  • fixing the tags and cover of a music library without re-encoding;
  • the 16 kHz mono WAV that speech recognition models such as Whisper expect;
  • trimming, fades and normalization before an upload, or ringtones;
  • audio editors: joins with crossfades, mixing, silence removal;
  • playing Opus or Vorbis on iOS, by converting to WAV first;
  • the same processing in a Dart backend.

More in Why frustbite.

What it does not do

frustbite does not play or record audio, and it writes WAV, FLAC and Opus but not MP3 or AAC (it does change the tags of MP3 and AAC files). For playback, hand the bytes from toWav() to a player package such as audioplayers, just_audio or media_kit. See What frustbite does not do.

WAV is sound with no compression: about 10 MB a minute, but it loses nothing and plays on almost every device. FLAC is lossless and about half the size. Opus is lossy and the smallest: a voice message is about 0.2 MB a minute. Opus in Ogg plays on Android and in browsers; Opus in CAF plays on an iPhone without extra apps. MP3 and AAC output wait for a pure-Rust encoder with a fitting license. What each format is and why, in Output formats.

Showcase

The Flutter showcase, pictured at the top, opens an audio file or a bundled sample and shows its stream info, tags, cover art and waveform. Its editor trims, fades, normalizes, resamples and converts to mono, plays the source and the result, and saves the result as WAV, FLAC or Opus with the source's tags and cover. Playback in the showcase uses audioplayers; the frustbite package does not depend on it.

Benchmarks

Benchmark chart: frustbite against other Dart audio packages

Headline numbers (180 s stereo input, Apple M3 Pro, median of 10 runs):

  • Decode WAV: 25.7 ms against 234.9 ms for the pure-Dart wav package (9.13x)
  • Decode MP3: 98.0 ms against 7964.9 ms for the pure-Dart glint_audio_pure (81.29x)
  • Decode MP3: 0.91x against audio_decode (88.8 ms), which is also native code
  • Read and write a WAV: 34.5 ms against 449.7 ms for wav (13.04x); resample 180 s of stereo to 48 kHz: 175.7 ms

Against native C decoders frustbite is roughly on par, and slower on MP3 decode. Methodology and every row are in the benchmark README.

Documentation

cd docs
npm install
npm run docs:dev

Blume builds the production site into docs/dist/ with cd docs && npm run docs:build.

See AGENTS.md for the repository layout and development commands.

License

See LICENSE. Third-party notices are in THIRD_PARTY_LICENSES.md; note that the bundled symphonia decoders are MPL-2.0, and that file says where to get their source.

About

Audio for Dart & Flutter with a Rust core: decode, tags, cover art, waveforms, trim, mix, fade, normalize, resample, save as WAV. Dart API over FFI and WebAssembly; no FFmpeg, every platform and the web.

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages