// Blog
Clarify.io - Making Audio and Video searchable in Java
Originally published on the Clarify.io blog. View archived copy.
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 helper libraries in a few to get you started. In Java, you can simply install the Clarify SDK via your Maven pom.xml
Loading Audio
Once you’ve installed the SDK, you instantiate the Clarify client by passing in your API Key. Next, you can create a bundle my passing in a name for your bundle and the audio/video URL itself:
Naming the bundle is optional. We have a number of audio and video files available for processing on our Media Page.
Hint: You don’t have to download these files. Instead you can pass us these urls via the .create() method shown above.
Searching Audio
To search, we’ll use the searchBundles() method. 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. This assumes that the audio clip has been indexed by the time you search. If it hasn’t, wait and try again in a few minutes.
And here are the results using the Wizard of Oz clip we loaded:
<div id="crayon-57fb42cc8306f996991668" class="crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
<div class="crayon-toolbar" data-settings=" mouseover overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><span class="crayon-title"></span>
<div class="crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;"><div class="crayon-button crayon-nums-button" title="Toggle Line Numbers"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-plain-button" title="Toggle Plain Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-wrap-button" title="Toggle Line Wrap"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-expand-button" title="Expand Code"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-copy-button" title="Copy"><div class="crayon-button-icon"></div></div><div class="crayon-button crayon-popup-button" title="Open Code In New Window"><div class="crayon-button-icon"></div></div><span class="crayon-language">PHP</span></div></div>
<div class="crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;"></div>
<div class="crayon-plain-wrap"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 12px !important; line-height: 15px !important;">
Dorothy and the Wizard of Oz 2.05 — 2.22 172.49 — 172.7 224.75 — 225.01 271.42 — 271.6 480.64 — 480.8
|
1 2 3 4 5 6 | Dorothy and the Wizard of Oz 2.05 — 2.22 172.49 — 172.7 224.75 — 225.01 271.42 — 271.6 480.64 — 480.8 |
Putting it all Together
From here, we can visualize our search results with the included audio player. The player should work with minimal additional configuration, but the bulk of the logic is already above in the results.