Releases: sjoenk/audio_decoder
v0.7.3
v0.7.3
Documentation & presentation improvements
Deze release verbetert de pub.dev presentatie en developer experience met een volledig vernieuwde Material 3 example app en uitgebreide code documentatie. Geen API changes - safe to upgrade.
Changes
- Added Material 3 example app screenshot voor pub.dev showcase
- Redesigned example app met Material 3 design system
- Color-coded status display (blauw=loading, groen=success, rood=error)
- Gradient waveform visualization met rounded corners
- Modern
FilledButton.tonalIconstyling
- Enhanced code documentation met inline comments bij alle AudioDecoder API calls
- Improved code organization met duidelijke sectie headers (Business logic, Bytes API, UI helpers)
- Added pub.dev quality badges (license, pub points, likes) to README
- Standardized
numberOfSamplesparameter naar 100 voor consistentie
Full Changelog: v0.7.2...v0.7.3
v0.7.2
v0.7.2
Fix: streaming resampling to avoid OOM on large files (Android)
Resampling verwerkt PCM data nu chunk-voor-chunk in de streaming decode pipeline, in plaats van het hele bestand in geheugen te bufferen. Dit voorkomt OOM crashes bij grote bestanden op devices met weinig geheugen.
| Scenario | Before | After |
|---|---|---|
| Groot bestand + resampling | ~2× decoded PCM size (OOM risico) | ~buffer size (paar KB) |
Changes
- Replace in-memory resampling with stateful chunk-based streaming (
ResamplerStatemet linear interpolation over chunk-grenzen) - Flush trailing fractional samples bij end-of-stream
- Pre-allocate resampler output buffer (minder GC pressure)
- Cap
targetSampleRateop 384 kHz ter bescherming tegen pathologische allocaties - WAV size validatie toegevoegd aan resampler flush branch
- ~90 regels duplicated decode loop code verwijderd
Full Changelog: v0.7.1...v0.7.2
v0.7.1
0.7.1
Bug fix
- Fix iOS build failure (
Module 'audio_decoder' not found) when used as a pub dependency (#25)
Changes
- Use
sharedDarwinSourcefor shared iOS/macOS podspec resolution (#26) - Remove orphaned
ios/andmacos/podspec directories - Sync podspec version with pubspec.yaml
Full Changelog: v0.7.0...v0.7.1
v0.7.0
v0.7.0
Streaming WAV conversion & internal improvements
WAV conversion now streams decoded PCM chunks directly to disk instead of buffering everything in memory. This significantly reduces peak memory usage, especially for large audio files.
Changes
- Streaming WAV conversion — stream decoded PCM to disk instead of buffering in memory
- Input validation —
sampleRate,channels, andbitDepthare now validated at the Dart level before calling native code (#17) - Shared Swift source — consolidated duplicate iOS/macOS plugin code into
darwin/Classes/(#24)
Full Changelog: v0.6.0...v0.7.0
v0.6.0
v0.6.0
Raw PCM output
convertToWavBytes accepts a new includeHeader: false parameter that returns only raw interleaved PCM samples — no 44-byte RIFF/WAV header. Useful for real-time audio pipelines, direct hardware interfaces, and custom audio processing.
Dart 3 class modifiers
All library classes now use Dart 3 class modifiers (base, final) to enforce intended usage contracts at compile time. Non-breaking for existing consumers.
Testing
Expanded integration tests to cover all native platform operations. Added web integration tests.
Full Changelog: v0.5.0...v0.6.0
v0.5.0
WAV Conversion Parameters
convertToWav and convertToWavBytes now accept optional sampleRate, channels, and bitDepth parameters, giving full control over WAV output encoding. When omitted, the source sample rate and channels are preserved with 16-bit depth (existing behavior).
// Convert to mono 44.1kHz 24-bit WAV
final path = await AudioDecoder.convertToWav(
'input.mp3', 'output.wav',
sampleRate: 44100,
channels: 1,
bitDepth: 24,
);
// Same for in-memory bytes
final wavBytes = await AudioDecoder.convertToWavBytes(
mp3Bytes,
formatHint: 'mp3',
sampleRate: 22050,
channels: 1,
bitDepth: 16,
);Supported values
| Parameter | Values | Default |
|---|---|---|
sampleRate |
Any valid rate (e.g. 8000, 22050, 44100, 48000) | Source sample rate |
channels |
1 (mono), 2 (stereo), or more | Source channel count |
bitDepth |
8, 16, 24, 32 | 16 |
Platform implementation
| Platform | Approach |
|---|---|
| iOS / macOS | AVAssetReader output settings |
| Android | Manual PCM resampling, channel conversion, bit depth conversion |
| Windows | Media Foundation media type attributes |
| Linux | GStreamer capsfilter |
| Web | OfflineAudioContext + manual encoding |
Full Changelog: v0.4.0...v0.5.0
v0.4.0
Web Support
audio_decoder now runs in the browser! The web platform uses the Web Audio API to decode and process audio entirely client-side.
What's supported on web
convertToWavBytes— decode any browser-supported format and encode to WAVgetAudioInfoBytes— extract duration, sample rate, channels, and bit ratetrimAudioBytes— trim audio to a time range (WAV output)getWaveformBytes— extract normalized amplitude data for visualizations
Web limitations
- File-based methods are not available — use the bytes-based API instead
- M4A encoding is not supported (browsers lack an AAC encoding API)
- Trim output is always WAV
Other improvements
- Added API documentation comments to all public classes and members
- Plugin now supports all 6 Flutter platforms: Android, iOS, macOS, Windows, Linux, and Web
Full Changelog: v0.3.0...v0.4.0
v0.3.0
Linux support
This release adds full Linux support using GStreamer as the native audio backend. All file-based and bytes-based methods are available on Linux — no additional Dart code changes needed.
Requirements
GStreamer 1.0+ is required (pre-installed on most Linux distributions). If needed:
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-badSupported platforms
| Platform | Native API |
|---|---|
| Android | MediaExtractor + MediaCodec |
| iOS | AVFoundation |
| macOS | AVFoundation |
| Windows | Media Foundation |
| Linux | GStreamer |
Full Changelog: v0.2.0...v0.3.0
v0.2.0
Bytes API — in-memory audio processing
This release adds a bytes-based API for working with audio data directly in memory, without file paths. Ideal for network responses, Flutter assets, or other in-memory sources.
New methods
convertToWavBytes— convert audio bytes to WAVconvertToM4aBytes— convert audio bytes to M4AgetAudioInfoBytes— retrieve metadata from audio bytestrimAudioBytes— trim audio bytes to a time rangegetWaveformBytes— extract waveform data from audio bytes
All methods accept a formatHint parameter to indicate the input format (e.g. 'mp3', 'm4a', 'wav').
Example
final wavBytes = await AudioDecoder.convertToWavBytes(
mp3Bytes,
formatHint: 'mp3',
);
**Full Changelog**: https://github.com/sjoenk/audio_decoder/compare/v0.1.0...v0.2.0v0.1.0
A lightweight Flutter plugin for audio file processing using native platform APIs — no FFmpeg required.
Features
- Audio Conversion — Convert between formats using platform-native decoders
convertToWav()— Lossless PCM 16-bit WAV outputconvertToM4a()— Compressed AAC/M4A at 128 kbps
- Audio Trimming — Extract a time range from any supported audio file
- Audio Analysis — Extract metadata (duration, sample rate, channels, bit rate, format)
- Waveform Extraction — Get normalized amplitude data (0.0–1.0) for visualization
Supported Platforms
| Platform | Min Version | Native API |
|---|---|---|
| Android | API 24 | MediaExtractor + MediaCodec |
| iOS | 13.0 | AVFoundation |
| macOS | 10.13 | AVFoundation |
| Windows | 7+ | Media Foundation |
Supported Input Formats
.mp3, .m4a, .aac, .mp4, .ogg, .oga, .opus, .flac, .wma, .aiff, .aif, .amr, .caf, .alac, .webm
Why This Plugin?
- ~500 KB vs 15–30 MB for FFmpeg-based alternatives
- Zero external dependencies — uses built-in OS audio APIs
- Background thread processing on all platforms
Full Changelog: https://github.com/sjoenk/audio_decoder/commits/v0.1.0