audio
A sound recording, such as a call recording or a voice message. Read what was said as a transcript timed in seconds, and listen to a stretch of it as a clip.
At a glance
- Stored as: a handle (
audio-…), kept once by its content and referred to by that handle. - Read in parts: by a range of seconds.
- Media formats:
mp3,wav,ogg,flac. - Search: by passage, so full-text and similarity search rank a value by its best passage.
Writing
- Send the recording: upload it, or give create its
file, its bytes, an http(s) URL or adata:URI. MP3, WAV, FLAC, Ogg (Opus included), WebM, M4A/AAC, AIFF and WMA are read; the recording is stored as WAV. An upload longer than four hours is refused. - To speak a text, call create with
opts{"kind": "tts"}and the text assource. Speech is a paid model call; the text you gave becomes the recording's transcript at once.
Written as
A JSON object.
__dtype__: str
Create options
Options for speaking a text as a new recording.
kind: optional "tts". Selects speech synthesis; source is the text to speak.voice_id: optional str or null. Provider voice id; the provider default when omitted.provider: optional "elevenlabs" or "openai". Speech provider.frame_rate: optional int. Sample rate in Hz.instructions: optional str or null. Delivery instructions, where the provider supports them.model: optional str or null. Provider model; the provider default when omitted.voice_settings: optional dict or null. Provider-specific voice settings.language_code: optional str or null. Language of the text, e.g. en.
Reading
- get_content reads the transcript:
rangeis in seconds ([60, 120], fractions allowed;[60]or"60-"runs to the end). Each line is one utterance,[start-end] text, its times in seconds. An utterance that overlaps the window is included whole, so the first line may start before it. A window in which nobody speaks reads as "no transcript in" that window. - Lines carry times, not speakers: each utterance's speaker and channel are in the transcript kept with the recording.
querysearches the transcript, and hits print as the same[start-end]lines, whose times you can pass back asrange.- The transcript is made the first time anyone reads it, or by the search index shortly after the recording is saved.
- get_media returns a link, valid for a limited time, to the
clip of
range(the whole recording without one), asmp3unless you ask forwav,oggorflac.
Querying
The transcript is indexed in passages of consecutive utterances, once it has been made, a
little after the save (see the HQL reference). ~= compares the
meaning of what was said, not the sound. For a recording, match.start and match.end are
seconds: pass them as range to read or play the hit. match.meta lists the passage's
utterances with their speaker and channel.
Call | recording ~~ "call me back tomorrow" | select id, match.text, match.start, match.end | limit 10
* | ~~ "cancel my order" | match.dtype = "audio" | select _concrete_type, id, match.start, match.text | limit 10
size.seconds is where the transcript's last speech ends, which can be a little short of
the recording's length, and it is there once the transcript is:
Call | recording.size.seconds > 1800 | select id, created_at, recording.size.seconds
In agent tools
- Pass the handle or its
<attachment id="…"/>marker. A generic file whose content is a recording is accepted too. - In a conversation, a model that takes audio hears the recording after its marker; any other model is given the transcript as text instead, made then if needed.
- Over MCP and the command line the agent gets the transcript and a link to the sound.
Metadata
Derived values kept with a stored value:
transcription: The transcript as a list of segments, each withstartandend(seconds),text,speakerandchannel; a transcript saved by the speech-to-text service also gives each segment itswordswith their times. Made the first time the transcript is read, or by the search index shortly after the recording is stored.transcript_details: The rest of a transcript saved by the speech-to-text service: its language, its speakers, what was redacted and its revision. Present only for such transcripts.speaker_timeline: Who spoke when, as a list of speakers, each with theintervals([start, end]in seconds) they spoke in. Set by the live call that made the recording; the transcript's speakers follow it.audio_header: Facts about the sound:duration(seconds),channels,frame_rate(samples per second),sample_width(bytes per sample) andrms_db(average loudness in dBFS). Worked out the first time it is read.recorded_at: When the recording started, as an ISO 8601 time, when known: set for voice messages recorded in a chat.channel_map: What each channel of a multi-channel call recording carries, as a list of{channel, kind, label, number}: channel 0 is the caller, 1 the agent, and each further channel one number the call was transferred to. Set when the call's recording is put together; absent otherwise.
Operations
Through the dtypes resource: