Reference

Speaker

Speaker identity for enrolled people, and the voice baseline

Speaker represents one voice. Every turn references a Speaker object, and the same object appears in Transcription.speakers.

class Speaker {
  readonly id: string;
  readonly label: string;
  readonly talkMs: number;
  readonly talkShare: number;
  readonly turnCount: number;
  readonly state: VoiceProfile;

  get talkSeconds(): number;
  get isUnknown(): boolean;

  toString(): string;
  toJSON(): SpeakerJSON;
}

Properties

PropertyTypeDescription
idstringOrganization-scoped UUID for the voice
labelstringStable display label in this transcription
talkMsnumberAttributed speaking time
talkSecondsnumbertalkMs / 1000
talkSharenumberShare of all attributed speaking time, 0 to 1
turnCountnumberAttributed transcript turns
stateVoiceProfileBaseline measured across this speaker's frames
isUnknownbooleantrue for unattributed audio

talkShare sums to 1 across Transcription.speakers. It is 0 for every speaker when the recording attributed no speaking time.

for (const speaker of result.speakers) {
  console.log(speaker.label, `${(speaker.talkShare * 100).toFixed(1)}%`);
}

The API mints id. For people your organization enrolls, with their consent, the same person resolves to the same UUID across recordings and live sessions. Identity indexes are isolated by organization, and enrollment is governed by the Voice Authentication Policy.

label is assigned by first appearance and remains stable when live speaker updates revise earlier turns.

Access

const [speaker] = result.speakers;

speaker.id;
speaker.label;
result.getSpeaker(speaker.id);
result.turnsBySpeaker(speaker);
result.conversation.getFrames(speaker.id);
result.conversation.getChanges(speaker.id);

turn.speaker holds the same object:

turn.speaker === result.getSpeaker(turn.speaker.id);

VoiceProfile

VoiceProfile is the speaker's measured baseline for the conversation: the reference everything speaker-relative is measured against.

interface VoiceProfile {
  intonation: {
    pitch: VoiceStat | null;
    range: VoiceStat | null;
    slope: VoiceStat | null;
  };
  stress: {
    loudness: VoiceStat | null;
    peak: VoiceStat | null;
  };
  rhythm: {
    voiced: VoiceStat | null;
    pause: VoiceStat | null;
    onset: VoiceStat | null;
  };
  tilt: VoiceStat | null;
  frameCount: number;
}
interface VoiceStat {
  median: number;
  min: number;
  max: number;
  count: number;
}

count is the number of frames that supplied the measurement. A nullable stat is null when every frame lacked that measurement.

speaker.state.intonation.pitch?.median;
speaker.state.stress.loudness?.min;
speaker.state.rhythm.pause?.max;

Transcription lookup

interface Transcription {
  speakers: Speaker[];
  frames: VoiceFrame[];
  moments: Moment[];
  vad: AffectVad | null;
  getSpeaker(id: string): Speaker | undefined;
  turnsBySpeaker(speaker: Speaker | string): TranscribeTurn[];
}

On this page