Skip to main content
Recording is opt-in and requires the voice dependencies. Configure it on the server after checking the basic conversation and silence policy.

Save one recording

Add to the earlier lessons’ dict-based configuration:
Restart the server, start a session, have a short exchange, then end the session. The recorder writes an MP3 in the configured directory. Check the file after the session closes and the recorder finishes.

Separate the speakers

The default layout is mixed mono. To keep the caller on the left channel and the assistant on the right:
The default bitrate is 32 kbps. Recordings contain the session audio, including spoken fillers. Browser-local thinking sounds and ambience are not part of the server’s recorded PCM.

After the file is saved

recording.on_saved accepts a Python async callback receiving the recording result. Use it for your storage integration after the files are written. Recordings are local files until your application uploads them; configure access, retention, and any required caller notice in your host application. Operator defaults use TIMBAL_VOICE_RECORDING_DIR, TIMBAL_VOICE_RECORDING_LAYOUT, and TIMBAL_VOICE_RECORDING_BITRATE_KBPS. Agent recording fields override them. File paths and callbacks are server-only settings and cannot be supplied by a browser hello. Direct VoiceSession(record_audio=True) keeps raw PCM in memory; it does not enable this file recorder. See Custom pipelines when embedding a session directly. Continue to Transports and phone calls to connect your application, and Events and usage to measure it.