In this guide we are showcasing how you can query the musical analysis for a audio file you uploaded to Cyanite.ai.
It assumes that you already configured a Webhook. In case you did not, we recommend you to work through the Integrating InDepthAnalysis guide first.
FastMusicalAnalysis and FullScaleMusicalAnalysis
The Cyanite.ai GraphQL API exposes two types of musical analyses. Both provide the option for retrieving information about the BPM and Key of your audio files. However, there are some differences.
FastMusicalAnalysis utilizes a less compute intense method for extracting BPM and Key which is applied on a short excerpt of the audio.
The results are therefore retrieved much quicker but still prove very stable in accuracy.
This is handy for an integration use-case that needs to show results as fast as possible.
FullScaleMusicalAnalysis utilizes a more computationally intense method for extracting BPM and Key.
The results are therefore most accurate with the trade-off of longer computational time than the
Enqueuing the Analysis
Both analyses types are automatically enqueued when enqueuing a
InDepthAnalysis with the
inDepthAnalysisEnqueueAnalysis GraphQL mutation.
For tracks that have already been analyzed before the introduction of
FullScaleMusicalAnalysis the analysis can be re-enqueued by using the same
inDepthAnalysisEnqueueAnalysis mutation again.
Querying for the Analysis Result
The result/error for a
FullScaleMusicalAnalysis can be retrieved by querying the API endpoint.
Example query for fetching both the
FullScaleMusicalAnalysis for a InDepthAnalysis record:
You can try this query on the GraphQL Playground.
Example Query Result:
FullScaleMusicalAnalysis has finished (or failed) a Webhook is sent to the configured integration endpoint.
The id sent with the payload can be used for querying for the result through the Cyanite.ai GraphQL API.