{"id":13618391,"url":"https://github.com/spotify/echoprint-server","last_synced_at":"2025-04-14T10:31:51.235Z","repository":{"id":45971863,"uuid":"55984799","full_name":"spotify/echoprint-server","owner":"spotify","description":"Server for the Echoprint audio fingerprint system","archived":true,"fork":false,"pushed_at":"2022-03-28T10:40:15.000Z","size":2954,"stargazers_count":395,"open_issues_count":12,"forks_count":100,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-05T17:13:40.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spotify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-11T15:33:56.000Z","updated_at":"2025-03-14T16:08:28.000Z","dependencies_parsed_at":"2022-07-18T09:09:06.463Z","dependency_job_id":null,"html_url":"https://github.com/spotify/echoprint-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotify%2Fechoprint-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotify%2Fechoprint-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotify%2Fechoprint-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spotify%2Fechoprint-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spotify","download_url":"https://codeload.github.com/spotify/echoprint-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248862697,"owners_count":21173861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:02:00.260Z","updated_at":"2025-04-14T10:31:49.248Z","avatar_url":"https://github.com/spotify.png","language":"Java","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# echoprint-server #\n\n[![Build Status](https://api.travis-ci.org/spotify/echoprint-server.svg)](https://travis-ci.org/spotify/echoprint-server)\n[![License](https://img.shields.io/github/license/spotify/echoprint-server.svg)](LICENSE)\n![Platforms supported: Linux and OS X](https://img.shields.io/badge/platform-Linux%20%7C%20OS%20X-blue.svg)\n\n**Note:** This project is no longer actively maintained\n\nA C library, with a Python extension module and Java bindings, for\nfast indexing and querying of [echoprint](http://echoprint.me/) data.\n\n\n## Installation ##\n\nThe standalone C library is built with CMake. This step is required\nfor using the Java (but not for the Python) bindings.\n\nTo build the Python extension module , run `python setup.py install`.\n\n## Usage ##\n\nThe rest of this file documents the usage of `echoprint-server` via\nthe Python extension module, through a set of convenience scripts in\nthe `bin/` directory.\n\nFor the Java bindings, please refer to the `UsageExample.java` file.\n\nThe echoprint code generator, used to convert audio files into\nechoprint strings, can be found here:\n[echoprint-codegen](https://github.com/echonest/echoprint-codegen).\n\n#### WARNING ####\n\nThe library uses a custom binary format for speed. At this point,\n**ENDIANNESS IS NOT CHECKED** so moving index files between machines\nwith different architectures might cause problems. The code has been\ntested on *little endian* machines.\n\nThe Java code for creating indices explicitly assumes a *little\nendian* architecture.\n\n\n### `echoprint-decode` ###\n\nConvert a codestring as output by `echoprint-codegen` into the\ncorresponding list of codes represented as comma-separated integers.\n\nUsage:\n\n\techoprint-codegen song.ogg \u003e codegen_output.json\n\tcat codegen_output.json | jq -r '.[0].code' | echoprint-decode \u003e codes.txt\n\n`codes.txt` will look like:\n\n`150555,1035718,621673,794882,40662,955768,96899,166055,...`\n\n*This script only outputs the echoprint codes, not the\n offsets. `jq` is a command line tool to process JSON strings, it can\n be found [here](https://stedolan.github.io/jq/).*\n\n\n### `echoprint-inverted-index` ###\n\nTakes a series of echoprint strings (one per line) and\nan output path. Writes a compact index to disk.\n\nUsage:\n\n    cat ... | ./echoprint-inverted-index index.bin\n\n`index.bin` format is binary, see the implementation details below.\n\nIf more than 65535 songs are indexed, the output will be split into\nblocks with the following naming scheme:\n\n    index.bin_0000\n\tindex.bin_0001\n\t...\n\nOptionally the `-i` switch switches the input format to a\ncomma-separated list of integer codes (one song per line).\n\n### `echoprint-inverted-query` ###\n\nTakes a series of echoprint strings (one per line) and a list of index\nblocks. For each query outputs results on stdout as json-encoded\nobjects.\n\nUsage:\n\n    cat ... | ./echoprint-inverted-query index-file-1 [index-file-2 ...]\n\nwhere the input is an echoprint string per line;\n\nEach output line looks like the following:\n\n```\n{\n  \"results\": [\n    {\n      \"index\": 0,\n      \"score\": 0.69340412080287933,\n    },\n    {\n      \"index\": 8,\n      \"score\": 0.56301175890117883,\n    },\n    {\n      \"index\": 120,\n      \"score\": 0.31826272477954626,\n    },\n    ...\n```\n\n\nThe `index` field represents the position of the matched song in the\nindex.\n\nOptionally the `-i` switch switches the input format to a\ncomma-separated list of integer codes (one song per line).\n\n\n## REST service ##\n\nThe `echoprint-rest-service` script listens for POST requests (by\ndefault on port 5678), with an echoprint string as `echoprint`\nparameter. The `test-rest.sh` shows how to query using `curl`.\n\nThe request is made to `host:query/\u003cMETHOD\u003e` with `\u003cMETHOD\u003e` one of\n\n- `jaccard`\n- `set_int`\n- `set_int_norm_length_first`\n\nUsage:\n\n\techoprint-rest-service index-file-1 [index-file-2 ...]\n\nThe optional `--ids-file` accepts a path to a text file where each\nline represents an id for the correspondingly-indexed track in the\nindex. If specified, the returned results will have an `id` field.\n\n## Example: querying from audio ##\n\nAssuming `0005dad86d4d4c6fb592d42d767e117f.ogg` is in the current\ndirectory, let's cut it from 00:30 to 4:30 and re-encode it as 128\nkbps mp3 (to show that echoprint is robust to alterations in the\nfile):\n\n\n\tffmpeg -i 0005dad86d4d4c6fb592d42d767e117f.ogg \\\n\t\t-s 30 -t 240 \\\n\t\t0005dad86d4d4c6fb592d42d767e117f_cut_lowrate.mp3\n\nRun the echoprint codegen, extract the echoprint string:\n\n    ../echoprint-codegen/echoprint-codegen\n        0005dad86d4d4c6fb592d42d767e117f_cut_lowrate.mp3 \\\n        | jq -r '.[0].code' \\\n        \u003e 0005dad86d4d4c6fb592d42d767e117f_cut_lowrate.echoprint```\n\nQuery the service:\n\n    curl -s --data \\\n        echoprint=`cat 0005dad86d4d4c6fb592d42d767e117f_cut_lowrate.echoprint` \\\n        \u003cserver-path\u003e:5678/query\n\nResults should be similar to\n\n    {\n      \"results\": [\n        {\n          \"id\": \"0005dad86d4d4c6fb592d42d767e117f\",\n          \"index\": 0,\n          \"score\": 0.34932565689086914\n        },\n        {\n          \"id\": \"ee59c151d679413a80ac4e49ac92c662\",\n          \"index\": 698096,\n          \"score\": 0.033668458461761475\n        },\n        {\n          \"id\": \"026526e6a02648668ff9f410faab15be\",\n          \"index\": 312466,\n          \"score\": 0.015930989757180214\n        },\n        ...\n      ]\n    }\n\n\n\n\n## Implementation details ##\n\n### Similarity ###\n\nThe similarity between two echoprints is computed on their\n**bag-of-words** representations. This means that the codes' offsets\nare not considered, nor are the codes' multiplicities.\n\n### Inverted index binary format ###\n\nThe inverted index is serialized as several *blocks*, each being a\nmemory dump of the `EchoprintInvertedIndexBlock` struct defined in the\nheader file.\n\n## License :memo:\nThe project is available under the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) license.\n\n## Contributing :mailbox_with_mail:\nContributions are welcomed, have a look at the [CONTRIBUTING.md](CONTRIBUTING.md) document for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspotify%2Fechoprint-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspotify%2Fechoprint-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspotify%2Fechoprint-server/lists"}