A smart macOS menubar application that listens to your environment and automatically plays masking sounds to help you focus by blocking out distractions.
- Overview
- Features
- Quick Start
- Installation
- Usage
- How It Works
- Project Architecture
- Development
- Building from Source
- Release Notes
- Contributing
- License
nonoice is an intelligent audio environment manager that uses machine learning to detect distracting sounds in your environment and automatically plays appropriate masking sounds to help you maintain focus. It runs quietly in your macOS menubar, listening to ambient sounds and reacting dynamically based on what it detects.
- Real-time Audio Classification: Uses YAMNet embeddings and a trained ESC-50 classifier to identify 50 different environmental sounds
- Intelligent Audio Mixing: Automatically adjusts masking sounds (brown noise, flowing river) based on distraction levels
- Three-Level Distraction System:
- π΄ High Distraction: Voices, alarms, sudden sounds β Strong water masking
- π‘ Medium Distraction: Mechanical sounds, drones β Brown noise masking
- π’ Low Distraction: Background nature sounds β Minimal masking
- Privacy-Focused: All audio processing happens locally on your machine
- π€ Real-time Audio Processing: Continuously listens and classifies sounds
- π§ AI-Powered Classification: Uses TensorFlow Hub's YAMNet for state-of-the-art audio embeddings
- π Adaptive Audio Masking: Automatically adjusts masking sound levels based on detected distractions
- ποΈ Smooth Audio Transitions: Gradual fading between masking sound levels for a pleasant experience
- π Status Monitoring: Real-time status updates showing detected sounds and confidence levels
- π Native macOS Notifications: Get notified when the app starts/stops or detects significant events
- π¨ Native Menubar Integration: Runs discreetly in your menubar (no dock icon)
-
Download the Latest Release
- Go to the Releases page
- Download
nonoice-v1.0.dmg - Open the DMG and drag
nonoice.appto your Applications folder
-
First Launch
- Open
nonoice.appfrom Applications - Grant microphone permissions when prompted
- The app will appear in your menubar (top-right)
- Open
-
Start Using
- Click the menubar icon
- Select "Start Listening"
- The app will automatically detect and mask distracting sounds
- macOS 11.0 (Big Sur) or later
- Microphone access permissions
- ~500MB free disk space
- Download
nonoice-v1.0.dmgfrom Releases - Open the downloaded DMG file
- Drag
nonoice.appto your Applications folder - Launch from Applications (you may need to allow the app in Security & Privacy settings on first launch)
See the Building from Source section below.
- Launch the App: Open
nonoice.appfrom your Applications folder - Start Listening: Click the menubar icon β "Start Listening"
- Monitor Status: View the current status and detected sounds in the menu
- Stop Listening: Click "Stop Listening" when you're done
- Start Listening: Begin audio detection and masking
- Stop Listening: Stop all audio processing
- Status: Shows current state:
- π’ Ready
- π’ Listening...
- π’ Safe / Background Noise
- π‘ Medium Distraction
- π΄ HIGH DISTRACTION
The app categorizes detected sounds into three levels:
-
π΄ HIGH DISTRACTION (e.g., voices, alarms, crying)
- Plays strong water masking sounds (80% volume)
- Mixes with light brown noise (20%)
-
π‘ Medium Distraction (e.g., vacuum, engine, airplane)
- Plays brown noise (90% volume)
- No water sounds
-
π’ Background Noise (e.g., rain, wind, nature sounds)
- Minimal masking
- Fades out masking sounds
- Audio Capture: Captures audio from your microphone at 16kHz (YAMNet's required sample rate)
- Feature Extraction: Uses YAMNet (TensorFlow Hub) to extract 1024-dimensional embeddings
- Feature Aggregation: Combines mean, max, and std pooling to create 3072-dimensional features
- Normalization: Applies the same scaler used during training
- Classification: Predicts sound class using a trained Random Forest classifier on ESC-50 dataset
- Prediction Smoothing: Averages predictions over the last 5 samples for stability
- Reaction Logic: Categorizes sounds and adjusts audio mixer accordingly
- Audio Processing: PyAudio, NumPy
- ML Framework: TensorFlow 2.x, TensorFlow Hub (YAMNet)
- Classification: scikit-learn (Random Forest)
- Audio Mixing: Pygame mixer
- UI Framework: rumps (macOS native menubar)
- Packaging: PyInstaller
The app recognizes 50 environmental sound classes including:
- Human sounds (breathing, coughing, laughing, crying)
- Domestic sounds (washing machine, vacuum cleaner, clock tick)
- Exterior sounds (airplane, train, car horn, siren)
- Animals (dog, cat, rooster, pig)
- Natural sounds (rain, wind, sea waves, thunderstorm)
nonoice/
βββ menubar/ # Main application
β βββ app.py # Menubar app entry point (rumps)
β βββ core/
β β βββ listener.py # Audio listener & classifier
β β βββ audio_mixer.py # Masking sound mixer
β βββ models/ # Trained classifier
β βββ scaler/ # Feature scaler
β βββ class_names/ # ESC-50 class names
β βββ images/ # App icons
β βββ masking_sounds/ # Brown noise & water sounds
β βββ requirements.txt # Python dependencies
β
βββ jupyternote/ # Development notebooks
β βββ yamnet_trainer.ipynb # Model training notebook
β βββ esc50_jupyter.ipynb # ESC-50 dataset exploration
β βββ realtime_audio_classifier.py
β
βββ assets/ # Shared assets
β βββ images/ # Icon files
β
βββ soundclassifier/ # ESC-50 dataset
β βββ ESC-50-master/
β βββ audio/ # 2000 audio files
β βββ audio_organized/ # Organized by class
β
βββ README.md # This file
- Main entry point using rumps framework
- Handles menubar UI and menu interactions
- Manages application lifecycle (start/stop)
- Displays status updates
- Captures audio from microphone using PyAudio
- Loads YAMNet model from TensorFlow Hub
- Extracts audio embeddings with combined pooling
- Runs trained classifier for sound classification
- Implements prediction smoothing
- Categorizes sounds and triggers audio mixer
- Manages masking sounds (brown noise, flowing river)
- Implements smooth volume transitions (fading)
- Three modes: HIGH, MEDIUM, LOW
- Threaded audio playback for smooth operation
- Python 3.8 or later
- macOS 11.0+ (for development and testing)
- pip package manager
-
Clone the Repository
git clone <repository-url> cd nonoice
-
Create a Virtual Environment (Recommended)
python3 -m venv venv source venv/bin/activate -
Install Dependencies
cd menubar pip install -r requirements.txt -
Ensure Model Files Are Present Make sure you have:
menubar/models/esc50_yamnet_classifier_best.pklmenubar/scaler/esc50_scaler.pklmenubar/class_names/esc50_class_names.pklmenubar/masking_sounds/brown-noise.wavmenubar/masking_sounds/flowing-river.wavmenubar/images/icon.pngmenubar/images/app_icon.icns
-
Run in Development Mode
python app.py
If you need to retrain the classifier:
-
Prepare ESC-50 Dataset
-
Run Training Notebook
jupyter notebook jupyternote/yamnet_trainer.ipynb
This will:
- Extract YAMNet embeddings for all ESC-50 samples
- Train a Random Forest classifier
- Save the model, scaler, and class names
-
Copy Trained Models
cp jupyternote/esc50_yamnet_classifier_final.pkl menubar/models/esc50_yamnet_classifier_best.pkl cp jupyternote/esc50_scaler.pkl menubar/scaler/esc50_scaler.pkl cp jupyternote/esc50_class_names.pkl menubar/class_names/esc50_class_names.pkl
- Python 3.8+
- PyInstaller 6.0+
- All development dependencies installed
-
Prepare the Environment
cd menubar pip install -r requirements.txt -
Create PyInstaller Spec File (if not exists) The spec file (
nonoice.spec) should already be in the repository. If not, create it with:pyinstaller --name nonoice \ --onedir \ --windowed \ --icon images/app_icon.icns \ --add-data "images:images" \ --add-data "masking_sounds:masking_sounds" \ --add-data "scaler:scaler" \ --add-data "models:models" \ --add-data "class_names:class_names" \ app.py
-
Build the App
pyinstaller nonoice.spec --clean --noconfirm
-
Verify Build
ls -la dist/nonoice.app
-
Test the App
open dist/nonoice.app
-
Build the App (see above)
-
Create DMG
hdiutil create -volname nonoice \ -srcfolder dist/nonoice.app \ -ov -format UDZO \ dist/nonoice-v1.0.dmg
-
DMG is Ready The DMG file will be in
dist/nonoice-v1.0.dmgand ready for distribution.
The nonoice.spec file configures:
- Data Files: Includes all assets (images, sounds, models, scaler)
- Hidden Imports: All required Python packages
- macOS Bundle:
- LSUIElement=1 (menubar app, no dock icon)
- Microphone permissions in Info.plist
- App icon configuration
- Optimizations: UPX compression, binary stripping
Initial Release
- β¨ Real-time audio classification using YAMNet + ESC-50
- ποΈ Three-level distraction detection (High/Medium/Low)
- π Adaptive audio masking with smooth transitions
- π¨ Native macOS menubar integration
- π System notifications for app events
- π Real-time status display
- π Local-only processing (privacy-focused)
Download: Available as nonoice-v1.0.dmg in Releases
Contributions are welcome! Here's how you can help:
- Fork the Repository
- Create a Feature Branch (
git checkout -b feature/amazing-feature) - Commit Your Changes (
git commit -m 'Add amazing feature') - Push to the Branch (
git push origin feature/amazing-feature) - Open a Pull Request
- π΅ Additional masking sounds
- π― Improved classification accuracy
- π± Additional platform support
- π Bug fixes and performance improvements
- π Documentation improvements
This project is licensed under the MIT License - see the LICENSE file for details.
- YAMNet: Google's TensorFlow Hub audio classification model
- ESC-50 Dataset: Karol Piczak's Environmental Sound Classification dataset
- rumps: Native macOS menubar app framework
- PyInstaller: Application packaging tool
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: See project files and notebooks
Made with β€οΈ for focused work