パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.3

waveform_fft

FFT(高速フーリエ変換)を用いたリアルタイム音声可視化およびマイクデータを使用した音声キャプチャ用のFlutterパッケージ

AndroidiOSLinux
30日間ダウンロード
27
いいね数
32
Pub ポイント
150

パッケージをインストール

flutter pub add waveform_fft

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Waveform_FFT は、高速フーリエ変換(FFT)を使用してマイク入力を処理することで、リアルタイムのオーディオ可視化を可能にするFlutterパッケージです。デバイスのマイクからオーディオデータを取得し、波形および周波数スペクトルに変換します。音楽アプリ、オーディオアナライザー、インタラクティブなサウンドプロジェクトに最適です。Android、iOS、Linux プラットフォームをサポートしており、クロスプラットフォーム音声アプリに適しています。pub add を通じた最小限のセットアップで、開発者はFlutterアプリにライブオーディオ解析機能を統合できます。

用途

  • リアルタイムオーディオ可視化
  • 音楽アプリ開発
  • オーディオスペクトル解析
  • インタラクティブ音響インスタレーション
  • 音声ベースのUIフィードバック

主な機能

  • リアルタイムFFT処理
  • マイク音声キャプチャ
  • クロスプラットフォーム対応(Android、iOS、Linux)
  • Flutter とのシンプルな統合
  • 視覚的な波形と周波数表示

適している対象

  • オーディオビジュアライゼーションアプリ
  • 音楽とリズムゲーム
  • 音反応型インターフェース
  • 音声分析のための教育ツール
  • ライブパフォーマンスアプリ

注意事項

  • ターゲットデバイスでのマイク権限が必要です
  • 低性能ハードウェアではパフォーマンスが異なる場合があります
  • 一部のプラットフォームではバックグラウンドオーディオ処理が制限されています
  • 最適なオーディオ品質のためには追加の設定が必要になる場合があります
  • 高精度のオーディオ録音には対応していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

waveform_fft

A Flutter package for real-time audio visualization using FFT (Fast Fourier Transform). This package captures audio input and displays it as an animated waveform using fl_chart.

Features

  • Real-time audio capture and frequency analysis
  • Customizable frequency spectrum ranges
  • Smooth animated waveform visualization
  • Support for different sample rates and buffer sizes
  • Easy-to-use API

Getting Started

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  waveform_fft: ^0.0.1
Platform Setup
Android

Add the following permissions to your android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
iOS

Add the following keys to your ios/Runner/Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to microphone to visualize audio.</string>
Customizing the Waveform

The WaveFormWidgetEq widget accepts several parameters for customization:

WaveFormWidgetEq(
  data: data,                                           // Frequency data
  animationDuration: Duration(milliseconds: 200),       // Animation speed
  updateInterval: Duration(milliseconds: 48),           // Update frequency
  barWidth: 5.0,                                       // Width of each bar
  maxY: 80.0,                                          // Maximum Y value
  minY: -80.0,                                         // Minimum Y value
  barColor: Colors.white,                              // Color of bars
  barAlpha: 0.5,                                       // Opacity of bars
);
Audio Capture Service

The AudioCaptureService can be customized with different sample rates and buffer sizes:

final service = AudioCaptureService(
  sampleRate: 44100,    // Default: 44100 Hz
  bufferSize: 256,      // Default: 256 samples
);

Note: The AudioCaptureService is a singleton and should be initialized once in your application.

Example

Here's a demo of the audio visualization in action:

Audio Visualization Demo

The example above demonstrates:

  • Real-time audio capture from device microphone
  • FFT processing of audio data
  • Animated waveform visualization
  • Responsive UI with start/stop recording controls

Check out the complete example code in the /example directory to see how to implement this in your app.

Frequency Spectrum

The package includes predefined frequency spectrum ranges from 0Hz to 22kHz, following standard audio frequency bands. You can customize these ranges by modifying the AudioWaveFormConstants.defaultFrequencySpectrum.

Performance Considerations
  • Higher sample rates provide better frequency resolution but require more processing power
  • Smaller buffer sizes reduce latency but may cause performance issues
  • Consider device capabilities when adjusting these parameters

Compatibility

  • Android: API 21+
  • iOS: iOS 13.0+
  • If you do not want to use raw audio data by microphone then you can use any other flutter package like record or flutter_sound etc for audio recording purpose.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Inspiration

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。