Get started →
Documentation

Record & transcribe calls

Record any call — a bridged conversation, a conference, or a single message — and get a transcript with speaker labels (Agent / Customer).

Record a bridged call

Set record on <Dial> to capture the conversation. Use record-from-answer-dual for a dual-channel stereo recording — channel 1 holds the A-leg, channel 2 the B-leg. This lets the transcription pipeline label speakers deterministically.

Examplets

import { VoiceResponse } from "@ruut/voice-sdk";

const xml = new VoiceResponse()
  .dial({ record: "record-from-answer-dual" }, (dial) => {
    dial.number("+2348000000009");
  })
  .toXml();

Record a voicemail-style message

Use the <Record> verb to capture a caller's message and optionally transcribe it:

TwiMLxml


  Please leave a message after the tone.
  

  • transcribe="true" — transcribe the recording after it completes.
  • transcribeCallback — receive a webhook with the transcript.
  • maxLength, timeout, finishOnKey — control how long to record.

Speaker diarization

Ruut Voice runs transcription through a self-hosted WhisperX pipeline (faster-whisper + pyannote). For dual-channel recordings, the two channels are split and labeled deterministically as agent / customer (the A-leg and B-leg). Mono recordings fall back to ML diarization (SPEAKER_00/01).

Enable WhisperX as your account's speech-to-text provider (set STT_DEFAULT_PROVIDER=whisperx / WHISPERX_DEFAULT_PROVIDER=whisperx on the platform). Transcription is then diarized automatically.

Channel mapping. For inbound calls, channel 1 = customer and channel 2 = agent. For outbound calls, the mapping is reversed (channel 1 = agent, channel 2 = customer).

Read the transcript

The transcript and its speaker-labeled segments are on the Recording resource:

read-transcript.tsts

const rec = await client.recordings.get("RE123");
console.log(rec.transcription_status);   // "completed"
console.log(rec.transcription_provider); // "whisperx"
console.log(rec.transcription_segments);
// [{ speaker: "agent", text: "…", start_time: 0.0, end_time: 3.2, words: [...] },
//  { speaker: "customer", text: "…", start_time: 3.2, end_time: 6.1, words: [...] }]

Play or download the audio

The recording is available as WAV or MP3:

Examplets

const wavUrl = client.recordings.mediaUrl("RE123", { format: "wav" });
const mp3Url = client.recordings.mediaUrl("RE123", { format: "mp3" });

Or stream it directly:

GETbash

GET /2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}.mp3

Webhooks

  • Recording availablerecordingStatusCallback fires when the recording is ready (see recording webhooks).
  • Transcription donetranscribeCallback fires with TranscriptionStatus and TranscriptionSegments (see transcription webhooks).