Search packages, repositories and app categories

Package detailsv0.1.0

wave_generator

A dart package to generate audio wave data on the fly

30-day downloads
8
Likes
30
Pub points
30

Install package

flutter pub add wave_generator

Package Overview

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

A Dart package designed to generate audio wave data in real time, enabling dynamic creation of sound signals such as sine, square, and sawtooth waves. Ideal for applications requiring custom audio synthesis without relying on pre-recorded files. The package provides low-level control over frequency, amplitude, and waveform type, making it suitable for music apps, sound effects, or educational tools demonstrating audio principles. It operates efficiently on the Dart VM and can be integrated into Flutter projects for interactive audio experiences.

Use cases

  • Real-time audio synthesis
  • Interactive music applications
  • Educational audio demonstrations
  • Sound effect generation
  • Custom tone generation

Key features

  • Supports multiple waveform types
  • Configurable frequency and amplitude
  • Lightweight and efficient
  • Generates raw audio data
  • Easy integration with Flutter

Suitable for

  • Developers building audio apps
  • Educational tool creators
  • Sound designers needing custom tones
  • Flutter projects requiring dynamic audio

Considerations

  • Does not handle audio playback directly
  • Requires external audio output implementation
  • Limited to waveform generation, not full audio processing

Original README

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

wave_generator

A dart package to generate audio wave data on the fly.

Usage

To use this plugin, add wave_generator as a dependency in your pubspec.yaml file.

Example
import 'package:wave_generator/wave_generator.dart';

() async {

    var generator = WaveGenerator(
        /* sample rate */ 44100,
        BitDepth.Depth8bit);

    var note = Note(
        /* frequency */ 220,
        /* msDuration */ 3000,
        /* waveform */ Waveform.Triangle,
        /* volume */ 0.5);

    var file = new File('output.wav');

    List<int> bytes = List<int>();
    await for (int byte in generator.generate(note)) {
      bytes.add(byte);
    }

    file.writeAsBytes(bytes, mode: FileMode.append);
  });

Or string together a sequence of Notes


 await for (int byte in generator.generateSequence([note1, note2, note3 /* etc */])) {
   // ...
 }

Features
  • Sin, Square, Triangle waves
  • 8 Bit depth

Categories

Source repository

Projects using this package

No data available yet.