Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwaszki committed Dec 28, 2023
1 parent 0c1e238 commit 506379f
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# fastwave

**fastwave** is a lightweight and efficient tool designed to accelerate the loading of audio files, with a primary focus on a specific type of WAVE files in PCM format. The project is implemented as a hybrid of C++ and Python, with a primary emphasis on Python bindings for ease of use.

## Features

### 1. Info Function

The `info` function provides detailed information about the loaded audio file. It returns an instance of the `AudioInfo` class, which includes essential details such as:

- Duration
- Sample rate
- Number of samples
- Number of channels
- Bit depth

### 2. Read Function

The `read` function loads the audio file and returns an instance of the `AudioData` class. This class has two properties:

- `data`: Contains the loaded audio file in NumPy format.
- `info`: Returns the previously mentioned `AudioInfo` class.

## Usage

Here's a simple example of how to use **fastwave** in Python:

```python
import fastwave

# Load audio file information
audio_info = fastwave.info("path/to/your/audio/file.wav")

# Print audio information
print("Duration:", audio_info.duration)
print("Sample Rate:", audio_info.sample_rate)
print("Number of Samples:", audio_info.num_samples)
print("Number of Channels:", audio_info.num_channels)
print("Bit Depth:", audio_info.bit_depth)

# Load audio data
audio_data = fastwave.read("path/to/your/audio/file.wav")

# Access loaded data and information
print("Loaded audio:", audio_data.data)
print("Audio duration:", audio_data.info.duration)
# ...
```

## Requirements

* Python (>=3.9)
* PDM

## Installation

To install **fastwave**, use the following commands:

```bash
# First clone the project from the repository.
git submodule update --init
pdm install --no-lock
```

## Installation

Contributions to fastwave are welcome! If you have any suggestions, feature requests, or bug reports, please create an issue or submit a pull request.

## License

*TBA*

0 comments on commit 506379f

Please sign in to comment.