Search packages, repositories and app categories

Package detailsv1.5.0

wav

Super simple pure Dart package for reading and writing WAV and raw audio files.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
14.2K
Likes
36
Pub points
160

Install package

flutter pub add wav

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A lightweight, pure Dart package for reading and writing WAV and raw audio files. It provides straightforward APIs to handle audio data without external dependencies, making it ideal for audio processing tasks in Flutter applications. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, ensuring broad compatibility. Designed for simplicity, it focuses on core audio file operations with minimal overhead.

Use cases

  • Audio file parsing
  • Raw audio data manipulation
  • Cross-platform audio I/O
  • Simple audio recording playback
  • Embedding audio in apps

Key features

  • Pure Dart implementation
  • Supports WAV and raw audio formats
  • No native dependencies
  • Multi-platform compatibility
  • Minimal API surface
  • Easy integration with Flutter

Suitable for

  • Developers needing basic audio file handling
  • Apps requiring audio data extraction or creation
  • Projects avoiding platform-specific code
  • Prototyping audio features
  • Lightweight audio processing

Considerations

  • Limited to WAV and raw formats
  • No support for compression or advanced audio codecs
  • Not suitable for high-performance audio streaming
  • Requires manual handling of sample rates and bit depths
  • No built-in audio playback capabilities

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

wav

pub package Build Status Coverage Status

Simple tools for reading and writing WAV and raw audio files. Written in pure Dart, with no dependencies.

This package currently supports reading and writing 8/16/24/32 bit PCM, and 32/64 bit float formats. Other formats can be added as needed (just file a bug).

This package also supports WAVE_FORMAT_EXTENSIBLE, but only for reading. Extensible WAVs are essentially treated as ordinary WAV files, because wValidBitsPerSample and dwChannelMask are ignored. Please file a bug if you have a use case for either of these metadata fields, or for writing extensible WAV files.

Usage

// Read a WAV file.
final wav = await Wav.readFile(filename);

// Look at its metadata.
print(wav.format);
print(wav.samplesPerSecond);

// Mess with its audio data.
for (final chan in wav.channels) {
  for (int i = 0; i < chan.length; ++i) {
    chan[i] /= 2;  // Decrease the volume.
  }
}

// Write to another WAV file.
await wav.writeFile(otherFilename);

Categories

Source repository

Projects using this package