Tree


.gitignorecommits | blame
CHANGELOG.mdcommits | blame
Cargo.lockcommits | blame
Cargo.tomlcommits | blame
LICENSEcommits | blame
README.mdcommits | blame
cliff.tomlcommits | blame
flake.lockcommits | blame
flake.nixcommits | blame
hack/
prek.tomlcommits | blame
src/

README.md

# virittaa

A command-line tool that analyzes audio files to detect `BPM` and `Key` tags.

## Features

* Detect BPM and Key of audio files
* Write detected BPM and Key to metadata tags
* Generate CSV reports of analyzed tracks
* Save track metadata to a database

## Building

To build the project, run:

```sh
cargo build --release
```

## Usage

```sh
./target/release/virittaa [OPTIONS] [PATH]...
```

### Arguments

*   `[PATH]...`: One or more files or directories to analyze. Not required when using `--list` or `--query`.

### Options

*   `-w`, `--write`: Write detected BPM and Key to audio file metadata.
*   `-f`, `--force`: Re-analyze files even if they already have BPM/Key tags.
*   `-j`, `--jobs <JOBS>`: Number of threads to use (0 = all cores).
*   `-r`, `--report`: Generate a CSV report with timestamped filename.
*   `-S`, `--save`: Save track reports (artist, track, BPM, key) to the database.
*   `-l`, `--list`: List all track reports stored in the database.
*   `--query <PATH>`: Look up a track report by file path.
*   `--db-path <PATH>`: Path to the database directory (default: `~/.local/share/virittaa.db`).
*   `-h`, `--help`: Print help information.
*   `-V`, `--version`: Print version information.

### Examples

```sh
# Analyze a single file
./target/release/virittaa /path/to/track.mp3

# Analyze a directory and write metadata tags
./target/release/virittaa --write /path/to/music/

# Re-analyze files that already have tags
./target/release/virittaa --force --write /path/to/music/

# Limit to 4 threads
./target/release/virittaa -j 4 /path/to/music/

# Generate a CSV report
./target/release/virittaa --report /path/to/music/

# Analyze and save reports to database
./target/release/virittaa --save /path/to/music/

# Write tags and save to database with custom path
./target/release/virittaa -w --save --db-path ~/my_library.db /path/to/music/

# Generate CSV report and save to database
./target/release/virittaa -r --save /path/to/music/

# List all tracks in the database
./target/release/virittaa --list

# Look up a specific track by file path
./target/release/virittaa --query /path/to/track.flac

# Query using a custom database path
./target/release/virittaa --list --db-path ~/my_library.db
```