An open API service indexing awesome lists of open source software.

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.

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.

![Detect Sound](./window.png)

## 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
```