Send the audio with the model call
The examples below usesetupObservability(). Read Integration Guide first if you have not set that up yet.
Vercel AI SDK
Put the recording in afile part inside the user message. mediaType is what tells LangWatch and the provider what the bytes are.
OpenAI SDK
Put the recording in aninput_audio part, as raw base64 with a format.
Audio shapes LangWatch understands
Send any of these and the recording is captured.
An OpenAI Realtime session sends its turns in the same
input_audio shape.
The format field accepts wav, mp3, flac, ogg and webm. A raw format such as pcm16 is accepted too, see the next section.
When a message holds both a recording and text, LangWatch treats the text as the transcript of that recording and shows the two together.
What happens to the bytes
LangWatch moves the recording out of the span at ingestion. The bytes go into content-addressed object storage and the message part becomes a/api/files/<projectId>/<id> reference, around 60 characters where the base64 was.
Storage is addressed by SHA-256, so identical bytes are stored once. For example, a recording captured by a simulation and by the trace of the same call is one stored object, not two.
Raw, header-less audio does not play in a browser on its own. LangWatch wraps pcm16 and G.711 payloads into a WAV container when it stores them, so the reference plays everywhere without a conversion step of your own.
Where the audio appears
Open the trace and the Summary tab shows a player under the input. The Conversation tab shows a player in the message it belongs to, next to the transcript. A turn that recorded no transcript still shows its player. The Trace tab shows the full message payload.Testing voice agents
You see what happened on a call once it has run. To drive a call on purpose and score it, use Scenario: it synthesizes a caller, speaks to your agent over its real transport, and scores the conversation withscenario.run().

Voice agent testing in Scenario, with the simulated call, its per-turn audio and the judge verdict
Related
- Capturing Images, for pictures and screenshots
- Capturing Documents, for PDF files and other attachments
- Voice Agent Testing, to run and score real-audio calls