2017 © Pedro Peláez
 

library acoust

A simple one-class wrapper for acoustid.org API

image

yeboahnanaosei/acoust

A simple one-class wrapper for acoustid.org API

  • Thursday, June 28, 2018
  • by yeboahnanaosei
  • Repository
  • 0 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

API wrapper for Acoustid.org

What this package can do :hammer:

  • Uses chromaprint to generate or retrieve fingerprint and duration of songs
  • Perform a lookup using the fingerprint of the song against acoustid.org database

Installation

Just run, (*1)

composer require yeboahnanaosei/acoust

How to use the package

You can use this package in two ways * To perform a lookup. (You will need an application API key from acoustid.org for this) * To generate the fingerprint and duration of the song for any other purpose you might have., (*2)

1. Perform a lookup, (*3)

Performing a lookup is as simple as calling just one method., (*4)

IMPORTANT: To perform a lookup of a song on acoustid.org database, you should have already obtained an application API key from acoustid.org, (*5)

try {
    // Set the needed parameters
    $song   = 'Path to song';      # Always required
    $apiKey = 'API key';           # Required when performing a lookup
    $format = 'json or xml'        # Optional. Defaults to 'json' if not supplied

    // Create instance of acoust
    // $format is optional and can be omitted
    // In that case $format will default to 'json'
    $acoust = new Acoust($apiKey, $song, $format);

    // All you need to do is to just call query() method
    // This method will return data from acoustid.org in
    // json format by default or in xml if you set your
    // format to xml
    $response = $acoust->query();
} catch (Throwable $e) {
    echo $e->getMessage();
}

2. Generate fingerprint or duration of song, (*6)

To only generate fingerprints of songs or durations of songs you only need the song. No need of an API key or a response format, (*7)

try {
    // Set needed parameters
    $song = 'Path to song';

    // Create an instance of acoust
    $acoust = new Acoust($song)

    // Generate fingerprint or duration of the song as you wish
    $fingerprint = $acoust->getFingerprint();
    $duration = $acoust->getDuration();


} catch (Throwable $e) {
    echo $e->getMessage();
}

Contributing :heart:

  • As always pull requests are graciously welcomed
  • Feel free to report bugs and also suggest improvements

The Versions

28/06 2018

dev-develop

dev-develop https://github.com/yeboahnanaosei/acoust

A simple one-class wrapper for acoustid.org API

  Sources   Download

MIT

The Requires

  • php >=7.1

 

fingerprint music acoustid.org audio fingerprinting acoustic fingerprint

26/06 2018

dev-master

9999999-dev https://github.com/yeboahnanaosei/acoust

A simple one-class wrapper for acoustid.org API

  Sources   Download

MIT

The Requires

  • php >=7.1

 

fingerprint music acoustid.org audio fingerprinting acoustic fingerprint

26/06 2018

v1.0.0

1.0.0.0 https://github.com/yeboahnanaosei/acoust

A simple one-class wrapper for acoustid.org API

  Sources   Download

MIT

The Requires

  • php >=7.1

 

fingerprint music acoustid.org audio fingerprinting acoustic fingerprint