How to recognize a music sample using Python and Gracenote?

Epoc picture Epoc · Jun 28, 2016 · Viewed 12.6k times · Source

I recently discovered the GNSDK (Gracenote SDK) that seems to provide examples in several programming languages to recognize music samples by fingerprinting them, and then to request their audio database to get the corresponding artist and song title.

But the documentation is horrible.

How can I, using Python and the GNSDK, perform a recognition of an audio sample file? There isn't any examples or tutorials in the provided docs.

Edit: I really want to use the GNSDK with Python. Don't post anything unrelated, you'll waste your time.

Answer

Epoc picture Epoc · Sep 11, 2016

I ended up using ACRCloud which works very well. Seems that everyone that want to use Gracenote fall back to ACRCloud for reasons... Now I know why.

Python example:

from acrcloud.recognizer import ACRCloudRecognizer

config = {
    'host': 'eu-west-1.api.acrcloud.com',
    'access_key': 'access key',
    'access_secret': 'secret key',
    'debug': True,
    'timeout': 10
}

acrcloud = ACRCloudRecognizer(config)

print(acrcloud.recognize_by_file('sample of a track.wav', 0))

https://github.com/acrcloud/acrcloud_sdk_python