Skip to content
pubscout

mp3_info

0.2.3, released 8 months ago by amugofjava.me.uk

Extract metadata such as sample rate, bitrate, and duration from MP3 files.

$ flutter pub add mp3_info
Source repository

What it does

Processes MP3 files in pure Dart to extract key metadata including MPEG version, layer version, bitrate, sample rate, duration, and optional ID3 tags. It supports constant bitrate (CBR) files and allows parsing from a file or bytes.

AI-written summary of version 0.2.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to read the duration or bitrate of an MP3 file in a pure Dart environment.
  • You want to extract basic ID3 tags and MP3 properties without native platform audio player dependencies.

Skip it when

  • You need to play, stream, or record audio files.
  • You need robust Variable Bitrate (VBR) support or comprehensive ID3 v2 tag support.

Strengths

  • Written in pure Dart making it easy to test and cross-compile.
  • Can process MP3 metadata directly from files or raw bytes.

Weaknesses

  • Variable Bitrate (VBR) support is not implemented.
  • Not all ID3 v2 tag types are fully supported.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'dart:io';
import 'package:mp3_info/mp3_info.dart';

main() {
  MP3Info mp3 = MP3Processor.fromFile(File("test_files/test_128kpbs_441khz_stereo_10s.mp3"));
  print('Bit rate: \${mp3.bitrate}bps');
  print('Duration: \${mp3.duration}');
}

Alternatives

Packages that do the same job and could replace mp3_info.