<clip> annotations in text. Use their timestamps for playback or editing in your application; the API does not return a cut audio file.
Locate an audible event
Installperceptron>=0.4.0, set PERCEPTRON_API_KEY, and place a short WAV recording at ./recording.wav. This example asks for the first alarm in your recording. If there is no clear alarm, the prompt asks the model to report that instead of inventing an interval.
vision_config.annotation_format: "clip" requests temporal annotations for audio as well as video. Standalone audio does not require enable_audio_in_video. For MP3, FLAC, remote URLs, or uploaded files, use the corresponding audio input form.
Ask for a moment or an interval
Reuselocate_event to ask for a single boundary instead of a duration:
Use audio transcription when you need the spoken words, or audio Q&A when you need an explanation of their meaning.
Keep timestamps attached to the recording
Times are measured in seconds from the start of the supplied recording. If you create an excerpt starting 120 seconds into a longer recording, a returned time of 2.4 seconds maps to 122.4 seconds in the original. Keep that offset with the excerpt when combining results.asset_idx="0" selects the recording in this example. The attribute is optional, even when requested: without an explicit or inherited selector, use the last asset available when the annotation was produced. With several recordings or other media, resolve the asset selector before interpreting times.
Validate before seeking or cutting
- Require a completed response. A
lengthfinish reason or interrupted stream can leave an unfinished annotation. - Check that times are finite, nonnegative, within the selected recording, and ordered for an interval. A moment needs an application-chosen interval before it can become a playable excerpt.
- Listen around the proposed boundary before making a precise cut. Requested tags and timestamps are model output to validate, not a guarantee of sample-accurate alignment.