Skip to content

Eittipat/audio_visualizer

Repository files navigation

audio_visualizer

This package transforms any integer stream into target frequency bands. Because this package just do a computation. So it should work on any platforms!

Credits

For ui https://github.com/iamSahdeep/FlutterVisualizers

For frequency bands https://github.com/keijiro/unity-audio-spectrum

Getting Started

You should look at example. It demostrates bar visualizer from microphone and music (pcm)

The example app running in Android

// Import package
import 'package:audio_visualizer/audio_visualizer.dart';

// Init visualizer
final visualizer = AudioVisualizer(
      windowSize: bufferSize,
      bandType: bandType,
      sampleRate: sampleRate,
      zeroHzScale: 0.05,
      fallSpeed: 0.08,
      sensibility: 8.0,
    );

// Do transform
StreamController<List<double>> audioFFT = ...
final result = visualizer.transform(samples, minRange: 0, maxRange: 255)
audioFFT.add(result)

// Use Stream to build widget
StreamBuilder(
    stream: audioFFT.stream,
    builder: (context, snapshot) {     
        final buffer = snapshot.data as List<double>;
        // render buffer somehow

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published