From b66d32c84eee29c530079468df3bf2802db86fc6 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 26 Dec 2023 23:51:58 +0200 Subject: [PATCH] Update the README --- README.md | 21 ++++++++++++++++++++- package.json | 7 ++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 776c4e3..1cf8516 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,26 @@ [![build](https://github.com/Polochon-street/bliss-rs/workflows/Rust/badge.svg)](https://github.com/Polochon-street/bliss-rs/actions) [![doc](https://docs.rs/bliss-audio/badge.svg)](https://docs.rs/bliss-audio/) -# bliss music analyzer - Rust version +# Fork notice +This repo is a fork of [bliss-rs](https://github.com/Polochon-street/bliss-rs) with bindings for Node.js (using N-API and Neon). + +## Example usage: +The package will be published to the Gitea registry and available for installation later. +```ts +import { analyze, analyzeSync } from 'bliss'; + +await analyze("/path/to/track.mp3") // returns Uint8Array +``` + +## Return value +The output of `bliss-rs` consists of single-precision floats, currently 20 of them. This fork contains code to convert it into an array of 80 bytes in little endian order. An additional version (also comes from `bliss-rs`, currently equal to `1`) is prepended at the start as 16 bits in platform endianness. Therefore, the total output size is 82 bytes. + +### Usage +The output (without the version) is meant to be converted back into floats and used to calculate the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance#Higher_dimensions) between two songs. Other distance algorithms are being worked on by the Bliss team. + +--- + +# (Original README) bliss music analyzer - Rust version bliss-rs is the Rust improvement of [bliss](https://github.com/Polochon-street/bliss), a library used to make playlists by analyzing songs, and computing distance between them. diff --git a/package.json b/package.json index 16366a4..f799585 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "bliss-rs", "version": "1.0.0", - "description": "[![crate](https://img.shields.io/crates/v/bliss-audio.svg)](https://crates.io/crates/bliss-audio) [![build](https://github.com/Polochon-street/bliss-rs/workflows/Rust/badge.svg)](https://github.com/Polochon-street/bliss-rs/actions) [![doc](https://docs.rs/bliss-audio/badge.svg)](https://docs.rs/bliss-audio/)", - "main": "index.js", + "description": "A fork of the bliss-rs library with Node.js bindings", + "main": "index.node", + "types": "index.d.ts", "directories": { "example": "examples" }, @@ -10,7 +11,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics" }, - "author": "", + "author": "antonlyap", "license": "ISC", "dependencies": { "cargo-cp-artifact": "^0.1.8"