Skip to content
Frustbite
Esc
↑↓navigate↵open⌘Jpreview
On this page

Frustbite

Read audio metadata, waveforms and PCM from Dart, powered by Rust.

Frustbite opens an audio file or a byte buffer and tells you what is inside: codec and stream info, tags, cover art, a waveform ready to draw, or the fully decoded PCM. The work is done by a Rust crate through FFI and Dart build hooks, or through WebAssembly in the browser. The Dart API is pure Dart.

Install

Add Frustbite to your pubspec.yaml:

dependencies:
  frustbite: ^0.0.2

Native binaries ship inside the package and are picked by Dart build hooks, with no download at build time.

Read an audio file

import 'package:frustbite/frustbite.dart';

final audio = Frustbite.fromFile('song.mp3');
try {
  print(audio.info);
  print(audio.tags.title);
  final peaks = audio.waveform(buckets: 200);
  print(peaks.channel(0).length);
} finally {
  audio.dispose();
}

What next?

Was this page helpful?