AI-Acoustic-Spectrum is a realtime web-based acoustic analysis system that combines Digital Signal Processing (DSP) with AI-assisted interpretation. The project captures live microphone audio, performs FFT-based spectral analysis, extracts acoustic features, and generates human-readable observations using the Gemini API.
The system was developed as an academic and research-oriented project focused on realtime audio visualization, acoustic feature extraction, backend streaming, and AI-integrated analysis.
The application performs realtime acoustic analysis directly in the browser using the Web Audio API. Audio features are processed and streamed to a Django backend through WebSockets, where additional processing and AI interpretation are performed.
The system includes:
- Realtime FFT spectrum visualization
- Waveform visualization
- Peak frequency detection
- RMS energy analysis
- Frequency-band energy estimation
- Realtime backend communication
- Gemini AI-based acoustic interpretation
- Responsive dashboard interface
Replace the image below with your main UI screenshot.
Replace the image below with your architecture or workflow diagram.
- React.js
- JavaScript
- Web Audio API
- HTML/CSS
- Django
- Django Channels
- Redis
- Celery
- WebSockets
- Google Gemini API
AI-Acoustic-Spectrum/
│
├── frontend/
│ ├── src/
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── components/
│ │
│ └── package.json
│
├── backend/
│ ├── acoustic_backend/
│ ├── analyzer/
│ │ ├── consumers.py
│ │ ├── routing.py
│ │ ├── tasks.py
│ │ └── gemini_service.py
│ │
│ ├── manage.py
│ └── requirements.txt
│
└── README.mdThe application captures live microphone input directly from the browser using the Web Audio API.
Realtime Fast Fourier Transform (FFT) analysis is used to visualize frequency-domain acoustic information.
The system extracts important DSP features including:
- Peak Frequency
- RMS Energy
- Bass Energy
- Mid-range Energy
- Treble Energy
Audio features are streamed between frontend and backend using WebSockets with Django Channels.
Extracted acoustic features are interpreted using the Gemini API to generate readable observations about the acoustic environment.
Create a Gemini API key from:
Inside the backend environment:
pip install google-generativeaiOpen:
backend/analyzer/gemini_service.pyAdd your API key:
import google.generativeai as genai
genai.configure(
api_key="YOUR_GEMINI_API_KEY"
)git clone https://github.com/your-username/AI-Acoustic-Spectrum.gitcd AI-Acoustic-SpectrumOpen a terminal inside the frontend directory:
cd frontendInstall dependencies:
npm installRun the frontend:
npm run devFrontend server:
http://localhost:5173Open another terminal inside the backend directory:
cd backendCreate virtual environment:
python -m venv venvActivate virtual environment:
venv\Scripts\activatesource venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun Redis using Docker:
docker run -p 6379:6379 redispython manage.py runserverBackend server:
http://127.0.0.1:8000Open another backend terminal:
celery -A acoustic_backend worker -l infows://127.0.0.1:8000/ws/audio/The system supports:
- Realtime FFT rendering
- Live waveform visualization
- Dynamic acoustic metric updates
- AI-generated acoustic observations
- Responsive dashboard rendering
- Realtime frontend-backend streaming
- The system currently uses a standard laptop microphone without professional calibration.
- Small environmental sounds may not always be classified accurately.
- Gemini responses are interpretive and not measurement-certified.
- Acoustic accuracy depends on microphone quality and surrounding conditions.
Possible future extensions include:
- RT60 reverberation analysis
- Advanced sound classification
- Multi-channel audio input
- Improved DSP feature extraction
- Cloud deployment support
- ML-based environmental sound recognition
-
Web Audio API
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API -
Django Documentation
https://docs.djangoproject.com/ -
Django Channels
https://channels.readthedocs.io/ -
Redis Documentation
https://redis.io/documentation -
React Documentation
https://react.dev/ -
Google Gemini API
https://ai.google.dev/
This project was developed as an individual academic and research-oriented project focused on realtime acoustic signal analysis and AI-assisted interpretation.

