Quantcast
Channel: The Echo Nest Developer Forum
Viewing all articles
Browse latest Browse all 1582

Javascript Track Analysis Segments

$
0
0

In case anyone is curious, I ended up just grabbing the analysis segments using the API in a Django Python server side script, which I deployed to Heroku. Given a track id "trid" and an echo nest key "ECHONESTKEY," the code to do this is as follows:

import json import requests

...

results = requests.get("http://developer.echonest.com/api/v4/track/profile?format=json&bucket=audio_summary&api_key=%s&id=%s"%(ECHONESTKEY, trid))
results = results.json()
track = results['response']['track']
analysis_url = track['audio_summary']['analysis_url']
print analysis_url
r = requests.get(analysis_url)
results = r.json()
print results['segments']

Viewing all articles
Browse latest Browse all 1582

Trending Articles