Audio analysis tool to detect bump/knock sounds in long WAV recordings.
- Create and activate virtual environment:
python3 -m venv venv
source venv/bin/activate- Install dependencies:
pip install -r requirements.txtBasic usage:
python bump_detector.py your_audio.wavOptions:
--threshold 2.5- Adjust sensitivity (lower = more sensitive, default: 3.0)--output results.json- Custom output file path--quiet- Minimal console output
The script generates:
- Console output with timestamps of detected events
- JSON file with detailed analysis results
Example output:
Analysis Results:
Duration: 02:30:45.123
Total detections: 23
Background level: 0.012345
Detection threshold: 0.037035
Detected events:
1. 00:05:23.456
2. 00:12:34.789
...
The detector uses two complementary methods:
- Onset Detection - Identifies sudden spectral changes using librosa
- Amplitude Thresholding - Finds peaks above background noise level
Results are combined and filtered to minimize false positives while capturing actual bump/knock events.