Real-time audio effects processor powered by Rust + WebAssembly
A professional-grade audio workstation running entirely in your browser with stunning visualizations and 15 effect presets!
Algorithms used from: https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html
You can try it from here: https://mohammedx6.github.io/rust-audio-dsp/
- Gain Control - Volume adjustment
- Low-Pass Filter - Remove high frequencies
- High-Pass Filter - Remove low frequencies
- Distortion - Warm analog-style saturation
- Delay/Echo - Time-based effects with feedback
- Clean - Pure audio
- Podcast - Broadcast quality
- Telephone - Vintage phone
- Radio - AM radio effect
- Walkie-Talkie - Two-way radio
- Robot - Robotic voice
- Alien - Extraterrestrial
- Ghost - Spooky effect
- Underwater - Submerged sound
- Cave - Indoor reverb
- Valley - Long dramatic echo
- Stadium - Sports arena
- Concert Hall - Live performance
- Space - Cosmic ambience
- Psychedelic - Trippy swirling
-
4 Visualization Modes:
- Waveform - Oscilloscope view
- Spectrum - Frequency analyzer
- Bars - Frequency bars
- Circle - Circular waveform
-
Live Audio Stats:
- Peak & RMS levels
- Dominant frequency detection
- DSP call counter
- Processing speed metrics
- Total data processed
- < 1% CPU usage - Incredibly efficient
- 170x faster than realtime - Rust power!
- Zero latency - Instant processing
- Clean audio - No background noise
- Rust 1.70+ (installed via rustup)
- wasm-pack
- Node.js 16+ (for local server)
- Modern web browser (Chrome, Firefox, Edge)
# 1. Install Rust via rustup (official toolchain manager)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 2. Add Rust to your PATH
source $HOME/.cargo/env
# 3. Install WASM target
rustup target add wasm32-unknown-unknown
# 4. Install wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# 5. Clone the repository
git clone https://github.com/mohammedX6/rust-audio-dsp.git
cd rust-audio-dsp
# 6. Install Node.js dependencies
npm install
# 7. Build the WASM module
npm run build
# 8. Start local server
npm start
# 9. Open browser
open http://localhost:8000This project requires rustup (the official Rust toolchain manager). If you installed Rust via Homebrew, you may encounter errors. The npm scripts automatically source the Rust environment from ~/.cargo/env.
To verify your setup:
# Should output: /Users/YOUR_USERNAME/.cargo/bin/rustc
which rustc
# Should list: wasm32-unknown-unknown
rustup target list --installedIf you have Rust via Homebrew, rustup will work alongside it. The package.json scripts are configured to use rustup's Rust installation.
rust-audio-dsp/
├── src/
│ └── lib.rs # Rust DSP implementation
├── docs/ # Documentation
│ ├── ARCHITECTURE.md
│ ├── RUST_GUIDE.md
│ ├── QUICK_REFERENCE.md
│ └── ...
├── pkg/ # Compiled WASM output (generated)
├── index.html # UI
├── main.js # Web Audio API integration
├── style.css # Styling
├── Cargo.toml # Rust dependencies
└── README.md # This file
# Development build
wasm-pack build --target web
# Release build (optimized)
wasm-pack build --target web --release- Rust - High-performance DSP processing
- WebAssembly - Near-native speed in browser
- Web Audio API - Browser audio integration
- Canvas API - Real-time visualizations
Comprehensive documentation is available in the docs/ folder:
- ARCHITECTURE.md - System architecture and data flow
- RUST_GUIDE.md - Complete Rust implementation guide
- QUICK_REFERENCE.md - Quick command reference
- DOCUMENTATION_INDEX.md - Documentation index
- AUDIO_IMPROVEMENTS.md - Audio processing improvements
Microphone → Browser Noise Suppression → JavaScript Noise Gate
↓
Rust/WASM DSP Processing:
• Gain
• Distortion
• Filters (Biquad)
• Delay/Echo
↓
Speakers
- Buffer Size: 4096 samples (16 KB per call)
- Sample Rate: 48 kHz (professional quality)
- Bit Depth: 32-bit float (maximum precision)
- Latency: < 1 ms processing time
- Processing Speed: ~170x realtime
- CPU Usage: 0.5-5% typical
- Memory: ~192 KB for Rust processor
- Data Rate: 192 KB/sec uncompressed
- Use headphones - Prevents feedback
- Start with Clean preset - Test baseline
- Try different presets - Explore effects
- Adjust individual controls - Fine-tune sound
- Watch the visualizer - See your audio!
- Radio DJ: Podcast + slight compression
- Sci-Fi Voice: Alien + Echo
- Haunted: Ghost + Cave reverb
- Retro Game: Robot + Short delay
- Zero-copy buffer processing
- Efficient biquad filters
- Circular delay buffer
- Optimized for WASM
- Web Audio API ScriptProcessor
- Real-time visualization (60 FPS)
- Performance monitoring
- Browser noise suppression
Contributions are welcome! Feel free to:
- Add new effects
- Improve presets
- Enhance visualizations
- Fix bugs
- Improve documentation
MIT License - see LICENSE file for details
- Built with Rust
- Powered by WebAssembly
- Audio processing via Web Audio API