npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

acr-cloud

v0.1.4

Published

ACR Cloud library

Downloads

7

Readme

ACR Cloud Node

ACR Cloud is a service that provides a cloud solution for audio fingerprinting and recognition. On their SDK and Tools section you can find Android, iOS, Java, Python, C# and C++ libraries.

There is also a web api and that is the one this library is build on top.

Installing

This package is available on npm registry:

npm install --save arc-cloud

How to use

First of all you have to require and make an instance of ACRCloud with the correct access key and secret:

var ACRCloud = require( 'acr-cloud' );
var acr = new ACRCloud({
	// required
	access_key: XXXXX,
	access_secret: XXXXX,
	// optional
	requrl: 'ap-southeast-1.api.acrcloud.com',
	http_method: 'POST',
	http_uri: '/v1/identify',
	data_type: 'audio',
	signature_version: '2',
	timestamp: Date.now()
});

This instance will provide you 4 methods:

createSignature()

When this method is called it will encrypt the http_method, http_uri, access_key, data_type, signature_version and timestamp using the access_secret as seed.

This method is a promise and will resolve it with the encrypted value but it will also keep an internal property called string_to_sign that is the unencrypted values.

createPostData( buffer, signature )

  • buffer: Base64 encoded audio file
  • signature: Encrypted signature generated by createSignature

This method is a promise that will resolve itself with an object containing the array of parameters to be used on the POST call and the query generated by this array.

post( postData )

  • postData: Object with array of post parameters and it's correspondent query

This method will do nothing but make a POST request with the postData and resolve itself returning the POST response.

identify( buffer )

  • buffer: Base64 encoded audio file

identify() is the main method of this module. It will call the previous described methods in the right order and handle all the process, the only thing you have to do is to feed it with the base64 encoded audio file.

This method is a promise and it will resolve itself returning the post response.

Example

There is a working version of this library on the folder example on this repository. Check it out for more detail.