|
We have just switched our analysis methods to use our new and improved analyzer by default (analysis_version=3). This means that all new upload tracks will be analyzed with the new version and any requests for analysis data (such as getting beats) will look for analysis_version=3 data. The new analyzer gives better data and is much more stable than the previous version, so we recommend that you use it, that is why it is now the default.
Note however that, with this change in default behavior, analysis for tracks analyzed with the old analyzer will not be returned. To get the old version of the analysis set the 'analysis_version' parameter to 1. For example, the call:
http://developer.echonest.com/api/get_beats?api_key=your-key
&id=music://id.echonest.com/~/TR/TRLFPPE11C3F10749F&version=3&analysis_version=1
will get beats from a version 1 analysis.
To see if a track already has an analysis for a given version you can call get_metadata with analysis_version set to the desired version. If the analysis status is COMPLETE then there is an analysis available, if the status is UNAVAILABLE this means that we know about the track but we haven't analyzed it yet with the given analysis_version - in which case you can reanalyze the track using the new 'analyze' method.
For example, the call:
http://developer.echonest.com/api/get_metadata?api_key=your-key
&id=music://id.echonest.com/~/TR/TRLFPPE11C3F10749F&version=3&analysis_version=1
will return metadata for the track with the given ID. Included in this metadata is an analysis status. This status can be one of:
- UNKNOWN The track has never been submitted for analysis. Submit the track for analysis.
- UNAVAILABLE The track has not been submitted for analysis for the requested analysis version. Resubmit the track to get the analysis for the requested version.
- PENDING The track has been submitted for analysis, but the analysis is not yet ready. Wait for status to change.
- COMPLETE The track has been analyzed.
- ERROR The track could not be analyzed.
Note that the client libraries such as pychonest should already handle this under the hood. If you are writing your own track uploader, follow these steps:
- Get the md5 for the track
- call get_metadata with the md5
- If the analysis status is UNKNOWN upload the track, poll get_metadata until the analysis status is COMPLETE
- If the analysis status is UNAVAILABLE call analyze with the md, poll get_metadata until the analysis status is COMPLETE
- If the analysis status is COMPLETE, the data is ready, call get_beats etc
|