Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

🎵 Audio recognition services API wrapper for Node.js

Notifications You must be signed in to change notification settings

iammordaty/audio-recognizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

audio-recognizer

Node.js module for audio recognition services.

Table of Contents

Getting Started

In order to use the module, you need to acquire credentials for your application, which can be obtained from the provider's websites.

Installation

This library can be installed through npm:

$ npm install --save audio-recognizer

Usage

The following example shows how to initialize the library and recognize track based on its fragment. Suggested fragment duration is 15 - 20 seconds.

const AudioRecognizer = require('audio-recognizer');

const config = {
    cache_success_responses: true,
    cache_dir: './cache',
    normalize_results: true,
    acrcloud: {
        host: '',
        access_key: '',
        access_secret: '',
        endpoint: '/v1/identify',
        signature_version: '1',
        data_type: 'audio'
    },
    auddmusic: {
        api_token: ''
    }
}

const recognizer = new AudioRecognizer(config);

recognizer.recognize('path-to-track-fragment.mp3')
    .then(results => /* process results */)
    .catch(e => /* handle error */);

Also, module can be used via commandline interface:

$ node cli -c cli/config.json fragment.mp3
ACRCloud recognition status: success.
 - The Rogue Element – Backbreaker (Rogue Rock) (released 2005-09-26 by Exceptional Records) (score: 76%)
 - Robert Vagner – Blaze (Hi, Everyone...) (released 2015-04-13 by Robert Vagner) (score: 76%)
 - Deky – Pincher's Dog (Welcome to My Mind) (released 2014-02-25) (score: 73%)

AudDMusic recognition status: success.
 - Robert Vagner – Blaze (Hi, Everyone...) (released 2015-04-13 by Robert Vagner)

Type node cli -h for more information.

Further information

See also

License

audio-recognizer is licensed under the MIT License.