Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/oleander/echoprint-rb

Echoprint server written in Ruby
https://github.com/oleander/echoprint-rb

Last synced: 4 days ago
JSON representation

Echoprint server written in Ruby

Awesome Lists containing this project

README

        

# Echoprint server written in Ruby

A Ruby music identification server that is compatible with the
[Echoprint](http://echoprint.me/) music fingerprinting client. This server is based on the original [echoprint-server](https://github.com/echonest/echoprint-server) and [node-echoprint-server](https://github.com/jhurliman/node-echoprint-server).

## Dependencies

- Ruby 2+
- PostgreSQL

To generate audio fingerprints you will need the [echoprint-codegen](https://github.com/echonest/echoprint-codegen) client.

## Installation

- Clone the project and enter the `echoprint-rb` folder.
- Install dependencies using `bundle install`.
- Set up the database.
- Copy `config/database-temp.yml` to `config/database.yml`.
- Change the credentials.
- Migrate the database using `rake db:create db:migrate`.
- Start the server using `rails s` on port 3000.

Take a look at the [example requests](#example-requests) section below for code examples.

## Endpoints

### POST /fingerprint/ingest

Adds a new music fingerprint to the database if the given fingerprint is unique, otherwise the existing track is returned.

- `code` - The code string output by echoprint-codegen.
- `version` - Field output by echoprint-codegen, currently `4.12`.
- `duration` - Track duration output by echoprint-codegen.
- `external_id` - A UUID value representing the tracks.

### GET /fingerprint/query

Queries for a track matching the given fingerprint.

- `code` - The code string output by echoprint-codegen.
- `version` - `metadata.version` field output by echoprint-codegen.

## Example requests

Take a look at the `examples` folder for complete examples of how to create a fingerprint.

## Tests

Invoke `rspec .` to run the test suite.

## TODO

- Optimize PostgreSQL indexes.
- Move fingerprint logic into a low level language like Rust or C.
- More tests.