A lightweight and customizable SwiftUI component for visualizing live microphone input as animated waves β perfect for voice interactions or playful UI feedback.
- Live audio input visualization
- Smooth animations & responsive design
- MVVM architecture for easy integration
- Reusable in any SwiftUI project
@StateObject private var viewModel = WaveInputViewModel()
@State private var selectedStyle: WaveStyle = .bar
WaveInputView(viewModel: viewModel, waveStyle: selectedStyle)
β―οΈ Use startMonitoring() and stopMonitoring() to control audio capture:
@StateObject private var viewModel = WaveInputViewModel()
WaveInputView(viewModel: viewModel, waveStyle: selectedStyle)
.frame(height: 150)
.frame(maxWidth: .infinity)
Button("Start Monitoring") { viewModel.startMonitoring() }
Button("Stop Monitoring") { viewModel.stopMonitoring() }
π Info.plist
<key>NSMicrophoneUsageDescription</key>
<string>We use your mic to visualize sound input as animated waves.</string>
π¦ Requirements
iOS 15+ SwiftUI Swift 5.7+
MIT Β© TEMIMI-MOHAMED