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