https://github.com/falleng0d/detect-sound
Python application that listens to audio input and performs actions based on the volume level. It includes a cooldown decorator and throttling logic to prevent the callback from being executed too frequently.
https://github.com/falleng0d/detect-sound
Last synced: 10 months ago
JSON representation
Python application that listens to audio input and performs actions based on the volume level. It includes a cooldown decorator and throttling logic to prevent the callback from being executed too frequently.
- Host: GitHub
- URL: https://github.com/falleng0d/detect-sound
- Owner: falleng0d
- Created: 2024-02-07T10:06:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-19T14:40:40.000Z (over 2 years ago)
- Last Synced: 2025-09-02T13:02:52.077Z (10 months ago)
- Language: Python
- Size: 83 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Detect Sound
Python application that listens to audio input and performs actions based on the volume level. It includes a cooldown decorator and throttling logic to prevent the callback from being executed too frequently.
TLDR: It listens to the microphone and executes a callback when the volume level exceeds a certain threshold. The callback is throttled to prevent it from being executed too frequently.

## Setting up venv
To set up a virtual environment for the project, follow these steps:
1. Ensure that you have Python installed on your system.
2. Navigate to the project directory in your terminal.
3. Run the following command to create a virtual environment:
```bash
python -m venv venv
```
4. Activate the virtual environment:
On Windows:
```bash
venv\Scripts\activate
```
On macOS and Linux:
```bash
source venv/bin/activate
```
5. Install the required dependencies:
```bash
pip install -r requirements.txt
```
## Running application
To run the application, make sure you are in the project directory and the virtual environment is activated. Then execute:
```bash
python main.py
```
## Linting
To lint the code, ensure that you have installed the required development dependencies. You can use `ruff` for linting:
```bash
ruff .
```
To automatically fix linting errors, run:
```bash
ruff . --fix
```