This quickstart demonstrates a simple way to get started using the Clarify API. Following these steps, it should take you no more than 5-10 minutes to have a fully functional search for your audio.
Configuring Your Environment
While you can use any programming language you choose, we provide a few helper libraries to get you started. In most cases, you can use your favorite package manager:
Although we don't have a curl library, the command-line JSON parser 'jq' is super helpful. Download and install it to get started: http://stedolan.github.io/jq/
You can install the Clarify SDK using Composer. In composer.json add:
And then simply run:
In Java, you simply install the Clarify SDK via your Maven pom.xml:
In Python, you simply install the Clarify module via pip:
In Ruby, you simply install the Clarify gem and set your API key as an environment variable:
First include the SDK and create your object using your API Key. Once you’ve created the object, you can use the object to load each of your audio files as shown:
Naming the bundle and providing a notify_url are both optional. We have a number of audio and video files available for processing on our Media Page.
Note: You don't have to download these files. Instead you can pass the urls via the create/POST method shown above.
After creating a bundle, you'll receive a response which looks something like this:
Note: While we process files as we receive them, there will be a delay before your file is available for searching. This is normally 1 minute for every minute of audio/video.
To search, you use the same object you created before and just search using your keywords. If you uploaded the “Wizard of Oz” audio clip, you can search for “dorothy”. Then you can process and interact the results however you wish.
The code below simply shows the resulting bundle id, bundle name, and the start/end offsets for each occurrence of the search terms:
And here are the results using the Wizard of Oz clip we loaded:
Note: Your results may be slightly different as our systems use machine learning and are improving constantly.
Putting it All Together
From here, we can visualize our search results with our included audio player. The player should work with minimal additional configuration, but the bulk of the logic is already above in the results.