Metadata-Version: 2.1
Name: silero-vad-lite
Version: 0.1.0
Summary: Lightweight wrapper for Silero VAD using internal ONNX Runtime and with no python package dependencies
Home-page: https://github.com/daanzu/py-silero-vad-lite
Author: David Zurow
Author-email: daanzu@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"

# Silero VAD Lite

**ATTENTION: Not ready for public use yet.**

Silero VAD Lite is a lightweight Python wrapper for the Silero Voice Activity Detection (VAD) model using ONNX Runtime. This package provides a simple interface to use the Silero VAD model without the need for the full ONNX Runtime Python package.

For more information, you can visit the [original Silero VAD repository](https://github.com/snakers4/silero-vad).

## Installation

You can install Silero VAD Lite using pip:

```
pip install silero-vad-lite
```

Note: This package requires CMake and a C++ compiler to be installed on your system.

## Usage

Here's a simple example of how to use Silero VAD Lite:

```python
from silero_vad_lite import SileroVAD
import numpy as np

# Initialize the SileroVAD object with the path to your ONNX model
vad = SileroVAD("path/to/silero_vad.onnx")

# Generate some dummy audio data (replace this with your actual audio data)
sample_rate = 16000
duration = 1  # 1 second
t = np.linspace(0, duration, int(sample_rate * duration), False)
audio_data = np.sin(2 * np.pi * 440 * t).astype(np.float32)

# Process the audio data
result = vad.process(audio_data, sample_rate)

print(f"Voice activity detection result: {result}")
```

The `process` method returns a float value between 0 and 1, indicating the probability of voice activity in the given audio segment.

## Building from Source

To build Silero VAD Lite from source:

1. Clone the repository:
   ```
   git clone https://github.com/yourusername/silero-vad-lite.git
   cd silero-vad-lite
   ```

2. Install the package in editable mode:
   ```
   pip install -e .
   ```

This will compile the C++ extension and install the package.

## Running Tests

To run the tests, first install pytest:

```
pip install pytest
```

Then, from the root directory of the project, run:

```
pytest
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- [Silero Team](https://github.com/snakers4/silero-vad) for the original Silero VAD model
- ONNX Runtime team for the C++ API

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
