Skip to content
pubscout

audio_decoder

0.8.1, released 6 months ago by an unverified publisher

Convert, trim, and analyze audio formats to WAV/PCM using native platform APIs without FFmpeg.

WASM-ready
$ flutter pub add audio_decoder
Source repository

What it does

A Flutter plugin that converts various audio formats (MP3, M4A, AAC, FLAC, OGG, etc.) to WAV or M4A, extracts audio metadata, trims files, and extracts waveform amplitude data. It relies purely on native platform APIs rather than bundled codecs.

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

Use it when

  • You need to convert or trim audio files natively without bundling heavy FFmpeg binaries.
  • You want to extract waveform amplitude data for audio visualization.
  • You need to work with in-memory audio bytes directly.

Skip it when

  • You need advanced audio playback functionality (use just_audio or audioplayers instead).
  • You need built-in audio recording capabilities (use record instead).

Strengths

  • No FFmpeg dependency required, keeping app size impact minimal.
  • Supports multiple platforms including Android, iOS, macOS, Windows, Linux, and Web.
  • Provides a flexible Bytes API for working with in-memory audio.

Weaknesses

  • File-based methods are not available on the web and require the bytes-based API.
  • M4A encoding is not supported on the web platform.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
2

No additional setup is needed for most platforms. Linux requires GStreamer development packages.

import 'package:audio_decoder/audio_decoder.dart';

final wavPath = await AudioDecoder.convertToWav(
  '/path/to/song.mp3',
  '/path/to/output.wav',
);

Alternatives

Packages that do the same job and could replace audio_decoder.

Works with

Packages commonly used together with audio_decoder: ones it builds on, ones built on it, and its own family.