Download the PHP package mrfeathers/acoustid without Composer
On this page you can find all versions of the php package mrfeathers/acoustid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrfeathers/acoustid
More information about mrfeathers/acoustid
Files in mrfeathers/acoustid
Package acoustid
Short Description Object Oriented PHP Wrapper for acoustid.org API
License MIT
Informations about the package acoustid
AcoustId API Wrapper
This package is an object oriented PHP wrapper for acoustid.org API.
Installation
Just require this package using Composer:
Usage
Create an instance of AcoustIdClient
:
Also, you can create client without api key. In this case, you are able to use
listByMBId
method, that doesn't need api key. All other methods throws an exception in this case.
Now you're ready!
So, acoustid.org has some available actions, that are represented in the package client:
-
Lookup by fingerprint
If you have an audio fingerprint generated by Chromaprint, you can use this method to lookup the MusicBrainz metadata associated with this fingerprint.
You will get an instance of class
ResultCollection
, contains several (or one) objects ofResult
class.ResultCollection
is iterable, so you can just use it as array: -
Lookup by track id
You can also look up data connected to a track ID, witch is a cluster of fingerprints.
The result also will be
ResultCollection
. -
Submit fingerprint
The AcoustID database depends on user-submitted content. This method can be used to submit new audio fingerprints and their corresponding metadata to the database. Multiple fingerprints can be submitted in one call.
Submissions are processed asynchronously by a background job. However, this normally only takes a few seconds, so if your application needs to get the imported AcoustIDs back, you can use the wait parameter to
wait
until the submissions are imported. It is not guaranteed that the submissions will be imported on time, so your application must be able to handle the case when the submission is still in the "pending" status. You can look up the status of the pending submissions later (use methodgetSubmissionStatus
).While you can submit a fingerprint without any metadata, it is not very useful to do so. If the file has embedded MusicBrainz tags, please send the MusicBrainz recording ID. Otherwise you can send the textual metadata.
Use
FingerPrintCollection
instance as argument. This class is just a wrapper under array ofFingerPrint
objects.You will get an instance of
SubmissionCollection
as a result. It's also iterable and contains one or moreSubmission
objects.- Get submission status
If you submitted an fingerprint and it was imported immediately, you can check the status of the submission
by looking up the ID from the submit
call.
The result also will be an instance of SubmissionCollection
.
- List AcoustIDs by MBID
This method will return you a list of AcoustId id that are corresponding to MusicBrainz id.
Api key is not required for this method, so you can use client without key to call it
You can send one or more mbids. If you send one, than you'll get the result as instance of TrackCollection
.
If you send more than one - instance of MBIdCollection
. Both are iterable.
Response models and Meta
Response models contain all known fields acoustid.org API can return. Unfortunately, acoustid.org doesn't have a full documentation
for all possible response structures. So if you get an AcoustidSerializerException
exception, please open an issue and provide
method and parameters you used to call it.
Here's the descriptions of all response models:
- Artist
- Date
- MBId
- Medium
- Recording
- Release
- ReleaseEvent
- Result
- Submission
- Track
Collection response models:
- MBIdCollection
- ResultCollection
- SubmissionCollection
- TrackCollection
NB! Response models has a lot of fields, but some of them can be empty. It's because of scope of meta parameters you send to the method. Different scope of meta values can return different results. All available meta values you can find in the class
Meta
. It's highly recommended to use constants fromMeta
class for creating meta array.
All versions of acoustid with dependencies
guzzlehttp/guzzle Version ^6.2
symfony/serializer Version ^4.0
symfony/property-info Version ^4.0
symfony/property-access Version ^4.0