Giter Club home page Giter Club logo

audio-fingerprint-chromaprint's Introduction

Audio::Fingerprint::Chromaprint

Get audio fingerprint using the chromaprint / AcoustID library

Build Status

Synopsis

use Audio::Fingerprint::Chromaprint;
use Audio::Sndfile;

my $fp = Audio::Fingerprint::Chromaprint.new;

my $wav = Audio::Sndfile.new(filename => 'some.wav', :r);

$fp.start($wav.samplerate, $wav.channels);

# Read the whole file at once
my ( $data, $frames ) = $wav.read-short($wav.frames, :raw);

# You can feed multiple times
$fp.feed($data, $frames);

# call finish to indicate done feeding
$fp.finish;

say $fp.fingerprint;

Description

This provides a mechanism for obtaining a fingerprint of some audio data using the Chromaprint library, you can use this to identify recorded audio or determine whether two audio files are the same for instance.

You need several seconds worth of data in order to be able to get a usable fingerprint, and for comparison of two files you will need to ensure that you have the same number of samples, ideally you should fingerprint the entire audio file, but this may be slow if you have a large file.

Depending on how the Chromaprint library was built, it may or may not be safe to have multiple instances created at the same time, so it is probably safest to take care you only have a single instance in your application.

Installation

You will need the chromaprint library v1 installed for this to work, many operating system distributions will have a package that you can install with appropriate software. If you do not have a package available you may be able to build it from the source which can be found at https://acoustid.org/chromaprint.

Assuming you have a working Rakudo installation (and the chromaprint library,) then you should be able to install the module with zef :

zef install Audio::Fingerprint::Chromaprint

Support

This is a fairly simple library, but if you find a problem with it or have a suggestion how it can be improved then please raise a ticket at github.

Copyright & Licence

This is free software.

See the LICENCE file in the distribution.

© Jonathan Stowe 2016 - 2021

audio-fingerprint-chromaprint's People

Contributors

jonathanstowe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

audio-fingerprint-chromaprint's Issues

Please add chromaprint_encode_fingerprint and chromaprint_decode_fingerprint

These two functions would let me store compressed fingerprints in the database and the decompress for comparison. These are very effective when compressing a fingerprint, especially if you can store the raw (non-base64) version, something like a 4:1 compression ratio.

I would also be interested in the comparison functions, but I read that the chromaprint comparison API is not fully implemented and not exposed in the C headers. I didn't have good luck when trying to use it either.

I do have a simple comparison algorithm that I've seen in a few other projects that I could contribute. It's written in C and based on algorithms that I've seen in other projects (https://codeberg.org/derat/soundalike for one) so maybe it's better off as a secondary module so this one does not require a C compiler 🤷

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.