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:
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:
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.