wav_io
3.0.2, released 5 months ago by an unverified publisher
Pure Dart library for reading, writing, streaming, and manipulating RIFF-WAV audio files.
What it does
wav_io allows developers to read, write, stream, and manipulate RIFF-WAV audio files directly in pure Dart without native dependencies. It supports broad audio formats, sample conversions, multichannel layouts, and metadata management.
AI-written summary of version 3.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to parse or generate WAV files in a pure Dart environment.
- You want to stream large WAV files sequentially to minimize memory usage.
- You need to convert audio sample formats or mix channels down to mono.
Skip it when
- You need to play or record live audio streams from a microphone or speaker hardware.
- You need to handle compressed audio formats like MP3, AAC, or FLAC.
Strengths
- Pure Dart implementation with no native dependencies.
- Supports both streaming reads and writes for low memory footprint.
- Broad support for various PCM and IEEE floating-point bit depths and channel masks.
Weaknesses
- Limited strictly to the WAV audio file format.
- Does not handle audio playback or device recording.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'dart:io';
import 'package:wav_io/wav_io.dart';
void main() {
final bytes = File('input.wav').readAsBytesSync();
final result = loadWav(bytes.buffer.asByteData());
result.match(
onOk: (wav) {
print("Channels: ${wav.numChannels}");
print("Sample Rate: ${wav.sampleRate} Hz");
},
onError: (error) {
print("Error loading WAV: $error");
},
);
}Alternatives
Packages that do the same job and could replace wav_io.
- audioplayers
A Flutter plugin to play multiple audio files simultaneously
87Compare - flutter_recorder
Low-level cross-platform audio recorder plugin using miniaudio with real-time waveform, FFT and volume.
87Compare - ogg_caf_converter
Converts OPUS audio files between OGG and CAF container formats using pure Dart.
71Compare - ffmpeg_kit_flutter_new_audio
Run FFmpeg and FFprobe commands from Dart with prebuilt audio codecs for multiple platforms.
79Compare