https://github.com/amirmahdyjebreily/microphone-quality-evaloution
Live microphone quality detection system in browser Js
https://github.com/amirmahdyjebreily/microphone-quality-evaloution
browser javascript microphone microphone-array-processing voice-processing voice-quality
Last synced: 20 days ago
JSON representation
Live microphone quality detection system in browser Js
- Host: GitHub
- URL: https://github.com/amirmahdyjebreily/microphone-quality-evaloution
- Owner: AmirMahdyJebreily
- License: mit
- Created: 2025-04-07T14:51:12.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-10T12:20:49.000Z (about 2 months ago)
- Last Synced: 2025-04-17T22:37:31.371Z (about 2 months ago)
- Topics: browser, javascript, microphone, microphone-array-processing, voice-processing, voice-quality
- Language: JavaScript
- Homepage: https://amirmahdyjebreily.github.io/Microphone-quality-evaloution/
- Size: 122 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ง Microphone Signal Quality Analyzer for JavaScript
A lightweight in-browser tool for evaluating **microphone signal quality** using the Web Audio API. It is designed to help users prepare optimal audio input for **speech-to-text models** such as Whisper, VOSK, or DeepSpeech โ without requiring control over gain settings.
## Install and usage
```bash
npm i microphone-quality-evaloution@latest
```
[Persian Version](./docs/README_Fa.md)
---
## ๐ Overview
This tool analyzes real-time microphone input and gives simple advice based on:
- **RMS (Root Mean Square)** energy of your voice
- **SNR (Signal-to-Noise Ratio)** in the speech frequency band
- **Power of the voice signal** and **background noise**
- User behavior (e.g., speaking too softly or loudly)The output is a short recommendation message, suitable for everyday users (no technical terms), along with a 1โ5 mic quality score.
---
## ๐ง Signal Processing works
The tool uses a chain of Web Audio nodes for analysis:
1. **`MediaStreamSource`** โ receives live audio input from the microphone.
2. **`BiquadFilterNode`** (bandpass) โ isolates the frequency range typical of human speech:
- Frequency range: **250 Hz to 4000 Hz**
- Center frequency: $`\frac{(250 + 4000)}{2} = 2125 Hz`$
- Quality factor: $`Q = \frac{center frequency}{bandwidth}`$
3. **`AnalyserNode`** โ uses FFT (size 16384) to measure the frequency-domain energy.Every 2 seconds:
- Computes **RMS** over the target frequency band
- Estimates power of the **voice** and **background noise**
- Calculates **SNR (in dB)** using:$`\text{SNR}_{dB} = 10 \cdot \log_{10}\left(\frac{P_{\text{signal}}}{P_{\text{noise}}}\right)`$
---
## โ What Makes โGoodโ Audio?
| Metric | Good Range | Notes |
|--------|-------------------|-----------------------------------------------------|
| RMS | ~20 to 70 | Too low = weak voice; too high = possible clipping |
| SNR | > 15 dB (ideal 18+) | Lower SNR indicates high noise or weak speech |Users are advised to:
- Speak clearly, at a moderate volume
- Move closer to the mic if needed
- Reduce ambient noise (e.g., fans, traffic)No gain or hardware control is assumed.
---
## ๐ฃ๏ธ Output Example
The tool displays:
- A brief **recommendation message** (e.g. โYour voice is too quietโ)
- **SNR value** and **RMS level**
- A **mic quality score** between 1 (poor) and 5 (excellent)---
## โ๏ธ Designed For
- Pre-checking mic setup for **speech recognition**
- Ensuring recording conditions are within **model-friendly bounds**
- Real-time use in web-based voice tools---
## ๐ Future Improvements
- Adaptive multi-band filters for more precise isolation
- ML-based noise profiling and environment classification
- User-specific calibration (tracking speaking habits over time)---
## ๐ Dependencies
- Web platform only
- No external JS libraries required
- Fully client-side, secure and lightweight---
> ๐งช Built for experimentation, prototyping, and real-world speech applications.
With โค๏ธ&โ by codeagha